diff --git a/.github/workflows/bump-and-tag.yml b/.github/workflows/bump-and-tag.yml index b06192d..a6263a5 100644 --- a/.github/workflows/bump-and-tag.yml +++ b/.github/workflows/bump-and-tag.yml @@ -6,7 +6,6 @@ on: - master paths-ignore: - 'js/index.js' - - '.github/workflows/**' permissions: contents: write @@ -87,9 +86,13 @@ jobs: trigger-release: needs: bump-version uses: ./.github/workflows/release.yml + with: + tag: ${{ needs.bump-version.outputs.tag }} secrets: inherit trigger-publish: needs: bump-version uses: ./.github/workflows/publish.yml + with: + tag: ${{ needs.bump-version.outputs.tag }} secrets: inherit diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 365f3b3..bd3422a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,10 @@ on: paths: - "pyproject.toml" workflow_call: + inputs: + tag: + required: false + type: string permissions: issues: write @@ -19,6 +23,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag || github.ref }} - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5d40f5..51c9b3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,10 @@ on: tags: - "v[0-9]+\\.[0-9]+\\.[0-9]+" workflow_call: + inputs: + tag: + required: false + type: string jobs: create_release: @@ -15,6 +19,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ inputs.tag || github.ref }} - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -29,7 +34,14 @@ jobs: run: | REPOSITORY=$(echo ${{ github.event.repository.name }}) echo "repository=$REPOSITORY" >> "$GITHUB_OUTPUT" - VERSION=$(basename ${{ github.ref }}) + + INPUT_TAG="${{ inputs.tag }}" + if [ -n "$INPUT_TAG" ]; then + VERSION="$INPUT_TAG" + else + VERSION=$(basename ${{ github.ref }}) + fi + echo "version=$VERSION" >> "$GITHUB_OUTPUT" VERSION_STRING=$(echo $VERSION | sed -e "s#\.#_#g") echo "version_string=$VERSION_STRING" >> "$GITHUB_OUTPUT"