Skip to content

Commit f43afaf

Browse files
committed
Add GitHub Actions to automatically build and release on every new tag/PR
1 parent 33de1d3 commit f43afaf

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 🔨 Build
2+
on:
3+
push:
4+
branches: [ $default-branch ]
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
name: Test Builds
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macOS-latest]
14+
steps:
15+
- name: Set up Go
16+
uses: actions/setup-go@v3
17+
with:
18+
go-version: 1.18
19+
20+
- name: Check out code
21+
uses: actions/checkout@v3
22+
23+
- name: Build
24+
run: go build -v ./...
25+
working-directory: .
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 🎉 Release Binary
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: "Check out code"
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: "Set up Go"
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: 1.19
20+
- name: "Create release on GitHub"
21+
uses: goreleaser/goreleaser-action@v3
22+
with:
23+
args: "release --rm-dist"
24+
version: latest
25+
workdir: .
26+
env:
27+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)