diff --git a/.github/workflows/common-release.yml b/.github/workflows/common-release.yml index bfdc9e74..97a4f382 100644 --- a/.github/workflows/common-release.yml +++ b/.github/workflows/common-release.yml @@ -81,14 +81,26 @@ jobs: # NOT push back: the branch needs no mutation, pushing would need write # access to the release branch, and src/version.ts is not path-ignored so # a push-back would re-trigger this workflow in a loop. + # Skipped entirely when the branch already carries the released version + # (the PR bumped it by hand): nothing to commit, and no push to a + # protected branch is attempted. - name: Commit Changes if: ${{ inputs.release-type == 'beta' || inputs.release-type == 'public' }} run: | git config user.name ${{ github.actor }} git config user.email ${{ github.actor }}@users.noreply.github.com + # The bump above ran on the detached tag checkout. Drop it, move to the + # source branch, and re-apply it there so the checkout cannot fail on + # local changes when the branch head has moved past the tag. + git checkout -- ${{ inputs.package-dir }}/package.json ${{ inputs.package-dir }}/src/version.ts git checkout ${{ env.branch_name }} + ./scripts/bump_version.sh "${{ inputs.product }}" "${{ steps.version.outputs.value }}" + if git diff --quiet -- ${{ inputs.package-dir }}/package.json ${{ inputs.package-dir }}/src/version.ts; then + echo "${{ inputs.product }} is already at ${{ steps.version.outputs.value }} on ${{ env.branch_name }}; skipping the version-bump commit." + exit 0 + fi git add ${{ inputs.package-dir }}/package.json ${{ inputs.package-dir }}/src/version.ts - git commit -m "[AUTOMATED] Release ${{ inputs.product }} - ${{ steps.version.outputs.value }}" || echo "nothing to commit" + git commit -m "[AUTOMATED] Release ${{ inputs.product }} - ${{ steps.version.outputs.value }}" git push origin ${{ env.branch_name }} - name: Publish diff --git a/.github/workflows/internal-release.yml b/.github/workflows/internal-release.yml index 8a21e2e8..1584d321 100644 --- a/.github/workflows/internal-release.yml +++ b/.github/workflows/internal-release.yml @@ -3,10 +3,14 @@ name: Internal Release # Branch-namespaced internal (JFrog) builds, routed per product: # flowvault-release/* -> skyflow-flowvault-node # skyvault-release/* | release/* -> skyflow-node (legacy release/* kept for skyvault) +# +# Branch pushes only. A `tags-ignore` filter used to live here, but with one +# present GitHub runs the workflow for every tag it does NOT match, and its +# single-star pattern never matched prefixed tags such as flowvault/1.0.0, so a +# public release tag also fired an internal build. With only `branches` set, +# tag pushes never trigger this workflow. on: push: - tags-ignore: - - '*.*' paths-ignore: - 'package.json' - 'package-lock.json' @@ -18,6 +22,8 @@ on: jobs: call-common-workflow: + # Belt and braces: never run for a tag ref, whatever the trigger says. + if: startsWith(github.ref, 'refs/heads/') uses: ./.github/workflows/common-release.yml with: product: ${{ startsWith(github.ref_name, 'flowvault-release/') && 'skyflow-flowvault-node' || 'skyflow-node' }}