diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 914109c..b93b96d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,13 +1,8 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Go +name: Go build and release on: push: branches: [ "main" ] - pull_request: - branches: [ "main" ] jobs: @@ -19,14 +14,20 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.20' + go-version: '1.23' - name: Build run: | GOOS=linux GOARCH=amd64 go build -v -o pretend-linux-amd64 GOOS=darwin GOARCH=amd64 go build -v -o pretend-darwin-amd64 GOOS=darwin GOARCH=arm64 go build -v -o pretend-darwin-arm64 - + + release: + runs-on: ubuntu-latest + needs: build + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v4 - name: Create Github Release and updaload assets uses: softprops/action-gh-release@v2 with: