@@ -21,80 +21,80 @@ jobs:
2121 id-token : write
2222
2323 steps :
24- - name : Generate token
25- id : app-token
26- uses : actions/create-github-app-token@v1
27- with :
28- app-id : ${{ vars.INTEGRATIONS_APP_ID }}
29- private-key : ${{ secrets.INTEGRATIONS_APP_PRIVATE_KEY }}
24+ - name : Generate token
25+ id : app-token
26+ uses : actions/create-github-app-token@v1
27+ with :
28+ app-id : ${{ vars.INTEGRATIONS_APP_ID }}
29+ private-key : ${{ secrets.INTEGRATIONS_APP_PRIVATE_KEY }}
3030
31- - uses : actions/checkout@v4
32- with :
33- token : ${{ steps.app-token.outputs.token }}
34- fetch-depth : 0
31+ - uses : actions/checkout@v4
32+ with :
33+ token : ${{ steps.app-token.outputs.token }}
34+ fetch-depth : 0
3535
36- - uses : actions/setup-node@v4
37- with :
38- node-version : 22.x
39- cache : npm
36+ - uses : actions/setup-node@v4
37+ with :
38+ node-version : 22.x
39+ cache : npm
4040
41- # Run install, test, and builds for sanity check.
42- - run : npm ci
43- - run : npm test
44- - run : npm run build
41+ # Run install, test, and builds for sanity check.
42+ - run : npm ci
43+ - run : npm test
44+ - run : npm run build
4545
46- - name : Get latest tag
47- id : latest_tag
48- run : echo "tag=$(git describe --abbrev=0 --tags 2>/dev/null || echo '')" >> "$GITHUB_OUTPUT"
46+ - name : Get latest tag
47+ id : latest_tag
48+ run : echo "tag=$(git describe --abbrev=0 --tags 2>/dev/null || echo '')" >> "$GITHUB_OUTPUT"
4949
50- - name : Bump semver tag
51- id : bump_tag
52- env :
53- LATEST_TAG : ${{ steps.latest_tag.outputs.tag }}
54- BUMP : ${{ inputs.bump }}
55- run : |
56- set -e
57- base=${LATEST_TAG#v}
58- if [[ -z "$base" ]]; then
59- echo "No tag found. Exiting."
60- exit 1
61- fi
62- IFS=. read -r maj min pat <<< "$base"
63- case "$BUMP" in
64- major) ((maj++)); min=0; pat=0 ;;
65- minor) ((min++)); pat=0 ;;
66- patch) ((pat++)) ;;
67- esac
68- next="$maj.$min.$pat"
69- echo "next_version=$next" >> "$GITHUB_OUTPUT"
70- echo "next_tag=v$next" >> "$GITHUB_OUTPUT"
50+ - name : Bump semver tag
51+ id : bump_tag
52+ env :
53+ LATEST_TAG : ${{ steps.latest_tag.outputs.tag }}
54+ BUMP : ${{ inputs.bump }}
55+ run : |
56+ set -e
57+ base=${LATEST_TAG#v}
58+ if [[ -z "$base" ]]; then
59+ echo "No tag found. Exiting."
60+ exit 1
61+ fi
62+ IFS=. read -r maj min pat <<< "$base"
63+ case "$BUMP" in
64+ major) ((maj++)); min=0; pat=0 ;;
65+ minor) ((min++)); pat=0 ;;
66+ patch) ((pat++)) ;;
67+ esac
68+ next="$maj.$min.$pat"
69+ echo "next_version=$next" >> "$GITHUB_OUTPUT"
70+ echo "next_tag=v$next" >> "$GITHUB_OUTPUT"
7171
72- # Updates package.json (but with no tag yet as it's not been committed)
73- - run : npm version ${{ steps.bump_tag.outputs.next_version }} --no-git-tag-version
72+ # Updates package.json (but with no tag yet as it's not been committed)
73+ - run : npm version ${{ steps.bump_tag.outputs.next_version }} --no-git-tag-version
7474
75- # 6. Commit + tag
76- - name : Commit & tag
77- run : |
78- git config --local user.name "github-actions[bot]"
79- git config --local user.email "github-actions[bot]@users.noreply.github.com"
80- git add package.json
81- git add package-lock.json
82- git commit -m "chore: bump version to ${{ steps.bump_tag.outputs.next_tag }}" || echo "nothing to commit"
83- git tag ${{ steps.bump_tag.outputs.next_tag }}
75+ # 6. Commit + tag
76+ - name : Commit & tag
77+ run : |
78+ git config --local user.name "github-actions[bot]"
79+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
80+ git add package.json
81+ git add package-lock.json
82+ git commit -m "chore: bump version to ${{ steps.bump_tag.outputs.next_tag }}" || echo "nothing to commit"
83+ git tag ${{ steps.bump_tag.outputs.next_tag }}
8484
85- - run : |
86- git push origin HEAD:${GITHUB_REF#refs/heads/}
87- git push origin ${{ steps.bump_tag.outputs.next_tag }}
88- env:
89- GH_TOKEN: ${{ steps.app-token.outputs.token }}
85+ - run : |
86+ git push origin HEAD:${GITHUB_REF#refs/heads/}
87+ git push origin ${{ steps.bump_tag.outputs.next_tag }}
88+ env:
89+ GH_TOKEN: ${{ steps.app-token.outputs.token }}
9090
91- - name : Create GitHub release
92- uses : ncipollo/release-action@v1
93- with :
94- tag : ${{ steps.bump_tag.outputs.next_tag }}
95- generateReleaseNotes : true
96- # Because workflows cannot be triggered from other workflows using the
97- # default "GITHUB_TOKEN", we need the elevated token from the installed
98- # GitHub App. See more:
99- # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow
100- token : ${{ steps.app-token.outputs.token }}
91+ - name : Create GitHub release
92+ uses : ncipollo/release-action@v1
93+ with :
94+ tag : ${{ steps.bump_tag.outputs.next_tag }}
95+ generateReleaseNotes : true
96+ # Because workflows cannot be triggered from other workflows using the
97+ # default "GITHUB_TOKEN", we need the elevated token from the installed
98+ # GitHub App. See more:
99+ # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow
100+ token : ${{ steps.app-token.outputs.token }}
0 commit comments