-
Notifications
You must be signed in to change notification settings - Fork 723
54 lines (47 loc) · 2.11 KB
/
build.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: Build and Release
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
check-latest: true
- name: Build binary
run: |
mkdir -p artifact
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o aurora -a -ldflags '-s -w -extldflags "-static"' . && rm -f artifact/aurora && cp aurora artifact/aurora && cd artifact && tar -czvf ../aurora-linux-amd64.tar.gz * && cd ..
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o aurora -a -ldflags '-s -w -extldflags "-static"' . && rm -f artifact/aurora && cp aurora artifact/aurora && cd artifact && tar -czvf ../aurora-windows-amd64.tar.gz * && cd ..
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o aurora -a -ldflags '-s -w -extldflags "-static"' . && rm -f artifact/aurora && cp aurora artifact/aurora && cd artifact && tar -czvf ../aurora-darwin-amd64.tar.gz * && cd ..
GOOS=freebsd GOARCH=amd64 CGO_ENABLED=0 go build -o aurora -a -ldflags '-s -w -extldflags "-static"' . && rm -f artifact/aurora && cp aurora artifact/aurora && cd artifact && tar -czvf ../aurora-freebsd-amd64.tar.gz * && cd ..
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: aurora-pre-built.zip
path: |
aurora-linux-amd64.tar.gz
aurora-windows-amd64.tar.gz
aurora-darwin-amd64.tar.gz
aurora-freebsd-amd64.tar.gz
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GHCR_PAT }}
with:
tag_name: v2.2.3
files: |
aurora-linux-amd64.tar.gz
aurora-windows-amd64.tar.gz
aurora-darwin-amd64.tar.gz
aurora-freebsd-amd64.tar.gz
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 1
keep_minimum_runs: 8