Skip to content

Commit

Permalink
bump version and release on successful run
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Mar 3, 2024
1 parent 056f65f commit 57b209a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:

build:
runs-on: macos-latest
permissions:
contents: write
strategy:
matrix:
go:
Expand All @@ -32,6 +34,8 @@ jobs:
- uses: actions/checkout@v4
with:
path: getargv.go
fetch-tags: true
fetch-depth: 0 # until https://github.com/actions/checkout/issues/1471 fixed
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand All @@ -43,3 +47,18 @@ jobs:

- name: Test
run: go test -C getargv.go

- name: Bump Version
id: bump_version
run: git tag | sort -V | tail -1 | awk -F. 'BEGIN { OFS = "." } {$NF+=1; print $0}' | xargs -I {} echo "new_version={}" >> $GITHUB_OUTPUT
working-directory: getargv-swift
- name: create && push tag
run: |
git tag '${{ steps.bump_version.outputs.new_version }}'
git push origin tag '${{ steps.bump_version.outputs.new_version }}'
git push origin HEAD:main
working-directory: getargv-swift
- uses: softprops/action-gh-release@v1
with:
name: ${{ steps.bump_version.outputs.new_version }}
tag_name: ${{ steps.bump_version.outputs.new_version }}

0 comments on commit 57b209a

Please sign in to comment.