Skip to content

Commit ac96a69

Browse files
committed
Set version number for GH release tag
1 parent 58a0a89 commit ac96a69

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ jobs:
6767
needs: [macOS, Docker_Linux]
6868
runs-on: ubuntu-latest
6969
steps:
70+
- name: Increment Release Version
71+
id: release_ver
72+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
73+
run: |
74+
curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest | jq -r '[.tag_name][0] | split(".") as $ver | $ver[-1]|tonumber as $last | $ver[:-1] as $first | $first + [$last+1] | map(tostring) | join(".")' > version
75+
echo "::set-output name=VERSION::$(<version)"
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7078
- name: Download all artifacts
7179
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
7280
uses: actions/download-artifact@v2
@@ -79,6 +87,7 @@ jobs:
7987
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
8088
uses: softprops/action-gh-release@v1
8189
with:
90+
tag_name: ${{ steps.release_ver.outputs.VERSION }}
8291
files: releases/*/*.xz
8392
env:
8493
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)