Skip to content

Commit

Permalink
fixup workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Mar 3, 2024
1 parent 57b209a commit 96b8b42
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:

build:
runs-on: macos-latest
permissions:
contents: write
strategy:
matrix:
go:
Expand All @@ -34,30 +32,34 @@ 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:
go-version: ${{ matrix.go }}
check-latest: true

- name: Build
run: go build -C getargv.go

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

release:
name: Release
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0 # until https://github.com/actions/checkout/issues/1471 fixed
- 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 }}
Expand Down

0 comments on commit 96b8b42

Please sign in to comment.