Skip to content

Commit

Permalink
Add version_overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
philnewm committed Oct 1, 2024
1 parent 105b90c commit 389357e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/release_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ on:
inputs:
draft:
type: boolean
major:
type: string
minor:
type: string
patch:
type: string
name:
release_overwrite:
type: string

secrets:
Expand All @@ -28,9 +22,7 @@ env:
GH_USER: ${{ secrets.user || secrets.CI_USER }}
GH_EMAIL: ${{ secrets.email || secrets.CI_EMAIL }}
DRAFT: ${{ inputs.draft }}
MAJOR: ${{ inputs.major || vars.MAJOR }}
MINOR: ${{ inputs.minor || vars.MINOR }}
PATCH: ${{ inputs.patch || vars.PATCH }}
NEXT_RELEASE: ${{ inputs.release_overwrite }}
RELEASE_NAME: ${{ inputs.name || '' }}
ARTIFACT_NAME: "${{ vars.PROJECT_NAME }}-package"
PROJECT_NAME: "${{ vars.PROJECT_NAME }}"
Expand Down Expand Up @@ -80,6 +72,7 @@ jobs:
# TODO Move release query logic into github action
get-latest-release:
if: ${{ ! inputs.release_overwrite }}
runs-on: ubuntu-latest
needs:
- verify_repo_vars_and_secrets
Expand Down Expand Up @@ -139,6 +132,7 @@ jobs:
increment-version:
if: ${{ ! inputs.release_overwrite }}
runs-on: ubuntu-latest
needs: get-latest-release
env:
Expand Down Expand Up @@ -228,7 +222,7 @@ jobs:
- merge-to-main
env:
OUTPUT_DIR: "artifact"
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version }}"
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version || inputs.release_overwrite }}"
outputs:
artifact_file: ${{ steps.create-artifact.outputs.file_name }}

Expand Down Expand Up @@ -283,8 +277,8 @@ jobs:
- increment-version
env:
OUTPUT_DIR: "artifact"
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version }}"
NEXT_PACKAGE_VERSION: "${{ needs.increment-version.outputs.next-version }}+dev"
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version || inputs.release_overwrite }}"
NEXT_PACKAGE_VERSION: "${{ needs.increment-version.outputs.next-version || inputs.release_overwrite }}+dev"

steps:
- name: ⬇️ Checkout ${{ github.ref_name }}
Expand Down Expand Up @@ -339,7 +333,7 @@ jobs:
- build-from-main
- increment-version
env:
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version }}"
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version || inputs.release_overwrite }}"

steps:
- name: 🔽 Download zip artifacts
Expand All @@ -364,7 +358,7 @@ jobs:
- create-release
- increment-version
env:
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version }}"
NEXT_VERSION: "${{ needs.increment-version.outputs.next-version || inputs.release_overwrite }}"
steps:
- name: Fetch Latest Release Draft
id: fetch-latest-release-draft
Expand Down
2 changes: 1 addition & 1 deletion caller_workflows/addon_repo_initial_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
call-release-trigger:
uses: ynput/ops-repo-automation/.github/workflows/initial_release.yml@main
uses: ynput/ops-repo-automation/.github/workflows/initial_release.yml@develop
with:
draft: ${{ inputs.draft }}
secrets:
Expand Down
7 changes: 6 additions & 1 deletion caller_workflows/addon_repo_release_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ on:
description: "Create Release Draft"
required: false
default: true
version_overwrite:
type: string
description: "Set Version Release Tag"
required: false

jobs:
call-release-trigger:
uses: ynput/ops-repo-automation/.github/workflows/release_trigger.yml@main
uses: ynput/ops-repo-automation/.github/workflows/release_trigger.yml@develop
with:
draft: ${{ inputs.draft }}
version_overwrite: ${{ inputs.version_overwrite }}
secrets:
token: ${{ secrets.YNPUT_BOT_TOKEN }}
email: ${{ secrets.CI_EMAIL }}
Expand Down

0 comments on commit 389357e

Please sign in to comment.