diff --git a/.github/actions/release-slack-bot/action.yml b/.github/actions/release-slack-bot/action.yml index 3f8338372..287c3ab4d 100644 --- a/.github/actions/release-slack-bot/action.yml +++ b/.github/actions/release-slack-bot/action.yml @@ -1,6 +1,9 @@ name: "Release Slack Bot" description: "Release Slack Bot" inputs: + release-tag: + required: true + description: "Release tag" slack-token: required: true description: "Slack token" @@ -13,7 +16,7 @@ runs: method: chat.postMessage token: ${{ inputs.slack-token }} payload: | - username: ${{ job.status == 'success' && format('Released codegen@{0}', github.ref_name) || format('Failed to release codegen@{0}', github.ref_name) }} + username: ${{ job.status == 'success' && format('Released codegen@{0}', inputs.release-tag) || format('Failed to release codegen@{0}', inputs.release-tag) }} channel: "#release" icon_emoji: "${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}" text: | diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 1445efd89..a1538661f 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -9,7 +9,7 @@ jobs: name: Semantic version runs-on: ubuntu-latest outputs: - tag: ${{ steps.semantic.outputs.git-tag }} + release-tag: ${{ steps.semantic.outputs.git-tag }} permissions: checks: read # to wait for required checks contents: write # to be able to publish a GitHub release @@ -36,10 +36,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} release: - if: ${{ needs.semantic-version.outputs.tag }} + if: ${{ needs.semantic-version.outputs.release-tag }} needs: semantic-version uses: ./.github/workflows/release.yml permissions: contents: write with: - tag: ${{ needs.semantic-version.outputs.tag }} + release-tag: ${{ needs.semantic-version.outputs.release-tag }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 919ed5d73..e3ac75a9d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Build & Release on: workflow_call: inputs: - tag: + release-tag: required: true type: string description: Tag to release @@ -13,7 +13,7 @@ on: # tag: # required: true # type: string - # description: Tag to release # TODO: create if it does not exist + # description: Tag to release push: tags: - v* @@ -51,7 +51,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ inputs.tag || github.event.pull_request.head.ref || github.ref }} + ref: ${{ inputs.release-tag || github.event.pull_request.head.ref || github.ref }} - name: Install UV uses: astral-sh/setup-uv@v5.2 @@ -80,7 +80,7 @@ jobs: path: ./wheelhouse/*.whl release: - if: ${{ inputs.tag || startsWith(github.ref, 'refs/tags/') }} + if: ${{ inputs.release-tag || startsWith(github.ref, 'refs/tags/') }} needs: build runs-on: ubuntu-latest environment: release @@ -108,7 +108,7 @@ jobs: id: github-release uses: softprops/action-gh-release@v2 with: - tag_name: ${{ inputs.tag || github.ref_name }} + tag_name: ${{ inputs.release-tag || github.ref_name }} files: dist/* fail_on_unmatched_files: true generate_release_notes: ${{ startsWith(github.ref, 'refs/tags/') }} @@ -117,5 +117,5 @@ jobs: if: always() uses: ./.github/actions/release-slack-bot with: - release-tag: ${{ github.ref_name }} + release-tag: ${{ inputs.release-tag || github.ref_name }} slack-token: ${{ secrets.SLACK_BOT_TOKEN }}