Skip to content

Commit 655ce77

Browse files
author
Mark Witt
committed
Add GitHub action to build and release
1 parent 5121f41 commit 655ce77

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Go Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build ${{ matrix.goos }}-${{ matrix.goarch }}
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
goos: [linux, windows, darwin]
18+
goarch: [amd64, arm64]
19+
exclude:
20+
- goos: windows
21+
goarch: arm64 # Exclude Windows ARM64 as it's a less common target
22+
steps:
23+
- name: Set up Go
24+
uses: actions/setup-go@v3
25+
with:
26+
go-version: "1.18"
27+
28+
- name: Check out code
29+
uses: actions/checkout@v3
30+
31+
- name: Build binary
32+
run: |
33+
env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o concopy-${{ matrix.goos }}-${{ matrix.goarch }}
34+
shell: bash
35+
36+
- name: Upload binary to Release
37+
uses: softprops/action-gh-release@v1
38+
with:
39+
files: concopy-${{ matrix.goos }}-${{ matrix.goarch }}
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)