-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.25 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build for macOS ARM
runs-on: ubuntu-latest
strategy:
matrix:
goos: [darwin]
goarch: [arm64]
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21' # Specify the Go version you want to use for building
- name: Check out code
uses: actions/checkout@v3
- name: Build binary
run: |
BINARY_NAME="gptprep-${{ matrix.goos }}-${{ matrix.goarch }}"
env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w" -o "${BINARY_NAME}"
- name: Archive binary
uses: actions/upload-artifact@v3
with:
name: gptprep-${{ matrix.goos }}-${{ matrix.goarch }}
path: gptprep-${{ matrix.goos }}-${{ matrix.goarch }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}