Skip to content

Commit

Permalink
Merge pull request #170 from GoogleCloudPlatform/fix-releaser
Browse files Browse the repository at this point in the history
Fix go releaser github action and add building test to catch issues before merging.
  • Loading branch information
brandonmichigangithub authored Sep 5, 2024
2 parents 9150753 + eef0eb6 commit 6e3c28f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-go@v1
- name: Checkout
uses: actions/checkout@v4
with:
go-version: 1.21.x
- uses: goreleaser/goreleaser-action@v2
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --rm-dist
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }
19 changes: 18 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on: [push, pull_request]
name: Test

jobs:
test:
go-test:
strategy:
matrix:
go-version: [1.21, 1.x] # Test 1.21 and tip
Expand Down Expand Up @@ -34,3 +34,20 @@ jobs:
run: |
go test -timeout 10s -v -tags=windows ./...
go test -race -timeout 10s -v -tags=windows ./...
goreleaser-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
- name: Build GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: build --snapshot --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6e3c28f

Please sign in to comment.