-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lorenz Kästle
committed
Jul 15, 2022
1 parent
0b2a3a9
commit b476879
Showing
1 changed file
with
40 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,52 @@ | ||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
|
||
- name: Build | ||
run: go build -v . | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- name: Run goreleaser in snapshot mode | ||
if: success() && ! startsWith(github.ref, 'refs/tags/v') | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist --snapshot | ||
|
||
- name: Build | ||
run: go build -v ./... | ||
- name: Upload assets for snapshots | ||
if: success() && ! startsWith(github.ref, 'refs/tags/v') | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: support-collector | ||
path: dist/* | ||
|
||
- name: Test | ||
run: go test -v ./... | ||
- name: Run goreleaser in release mode | ||
if: success() && startsWith(github.ref, 'refs/tags/v') | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |