@@ -46,23 +46,26 @@ jobs:
4646
4747 - name : Configure git
4848 run : |
49- git config user.name "github-actions[bot] "
50- git config user.email "41898282+github-actions[bot]@users.noreply.github .com"
49+ git config user.name "nerjs "
50+ git config user.email "nerjs.stap@gmail .com"
5151
5252 - name : Compute next version
5353 id : ver
54+ env :
55+ BUMP_LEVEL : ${{ inputs.version }}
56+ IS_BETA : ${{ inputs.beta }}
5457 run : |
5558 set -euo pipefail
5659 CURRENT=$(cargo read-manifest | jq -r .version)
5760 BASE_CURRENT=${CURRENT%%-*}
5861 IFS=. read MAJ MIN PAT <<< "$BASE_CURRENT"
59- case "${{ inputs.version }} " in
62+ case "$BUMP_LEVEL " in
6063 patch) NEXT_BASE="$MAJ.$MIN.$((PAT+1))" ;;
6164 minor) NEXT_BASE="$MAJ.$((MIN+1)).0" ;;
6265 major) NEXT_BASE="$((MAJ+1)).0.0" ;;
6366 esac
6467 git fetch --tags
65- if [ "${{ inputs.beta }} " = "true" ]; then
68+ if [ "$IS_BETA " = "true" ]; then
6669 N=$(git tag --list "v${NEXT_BASE}-beta.*" | sed "s/.*-beta\.//" | sort -n | tail -n1)
6770 N=$((${N:-0}+1))
6871 NEXT="${NEXT_BASE}-beta.${N}"
@@ -73,22 +76,28 @@ jobs:
7376 echo "next=$NEXT" >> "$GITHUB_OUTPUT"
7477
7578 - name : Commit
79+ env :
80+ NEXT_VERSION : ${{ steps.ver.outputs.next }}
81+ COMMIT_NOTE : ${{ inputs.commit_note }}
7682 run : |
77- VERSION="${{ steps.ver.outputs.next }}"
78- MSG="Bump version to v${VERSION}"
79- NOTE="${{ inputs.commit_note }}"
80- if [ -n "$NOTE" ]; then
81- MSG="${MSG}"$'\n\n'"${NOTE}"
83+ set -euo pipefail
84+ MSG="Bump version to v${NEXT_VERSION}"
85+ if [ -n "$COMMIT_NOTE" ]; then
86+ MSG="${MSG}"$'\n\n'"${COMMIT_NOTE}"
8287 fi
8388 git add Cargo.toml Cargo.lock
8489 git commit -m "$MSG"
8590
8691 - name : Tag and push
8792 id : tag
93+ env :
94+ NEXT_VERSION : ${{ steps.ver.outputs.next }}
95+ BRANCH : ${{ github.ref_name }}
8896 run : |
89- TAG="v${{ steps.ver.outputs.next }}"
97+ set -euo pipefail
98+ TAG="v${NEXT_VERSION}"
9099 git tag -a "$TAG" -m "$TAG"
91- git push origin "${{ github.ref_name }} " --follow-tags
100+ git push origin "$BRANCH " --follow-tags
92101 echo "tag=$TAG" >> "$GITHUB_OUTPUT"
93102
94103 release :
@@ -103,9 +112,12 @@ jobs:
103112 - name : Create GitHub Release
104113 env :
105114 GH_TOKEN : ${{ secrets.RELEASE_TOKEN }}
115+ TAG : ${{ needs.bump.outputs.tag }}
116+ IS_BETA : ${{ inputs.beta }}
106117 run : |
118+ set -euo pipefail
107119 FLAGS="--generate-notes"
108- if [ "${{ inputs.beta }} " = "true" ]; then
120+ if [ "$IS_BETA " = "true" ]; then
109121 FLAGS="$FLAGS --prerelease"
110122 fi
111- gh release create "${{ needs.bump.outputs.tag }} " $FLAGS
123+ gh release create "$TAG " $FLAGS
0 commit comments