-
Notifications
You must be signed in to change notification settings - Fork 26
85 lines (76 loc) · 3.79 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release
on:
push:
tags:
- 'v*'
jobs:
publish_upload:
name: Publish and upload
runs-on: ubuntu-latest
container:
image: archlinux/archlinux:base-devel
steps:
- name: Install Git & Go
run: pacman -Syu --needed --noconfirm gcc git go
- name: Disable Git's stupid security theater
run: git config --global safe.directory '*'
- name: Git Checkout Tag
run: |
cd ../
rm -rf ${{ github.event.repository.name }}
git clone --branch ${{ github.ref_name }} https://github.com/${{ github.repository }}.git
- name: Build
run: |
mkdir package-archlinux-x86-64-v2 \
package-archlinux-x86-64-v3 \
package-linux-x86-64-v2 \
package-linux-x86-64-v3 \
package-linux-arm64 \
package-windows-x86-64-v2 \
package-windows-x86-64-v3 \
package-windows-arm64 \
package-macos-x86-64-v3 \
package-macos-arm64 \
env GOAMD64=v2 go build -v -trimpath -ldflags '-s -w' -o package-archlinux-x86-64-v2/ ./cmd/swgp-go
env GOAMD64=v3 go build -v -trimpath -ldflags '-s -w' -o package-archlinux-x86-64-v3/ ./cmd/swgp-go
env CGO_ENABLED=0 GOAMD64=v2 go build -v -trimpath -ldflags '-s -w' -o package-linux-x86-64-v2/ ./cmd/swgp-go
env CGO_ENABLED=0 GOAMD64=v3 go build -v -trimpath -ldflags '-s -w' -o package-linux-x86-64-v3/ ./cmd/swgp-go
env CGO_ENABLED=0 GOARCH=arm64 go build -v -trimpath -ldflags '-s -w' -o package-linux-arm64/ ./cmd/swgp-go
env CGO_ENABLED=0 GOAMD64=v2 GOOS=windows go build -v -trimpath -ldflags '-s -w' -o package-windows-x86-64-v2/ ./cmd/swgp-go
env CGO_ENABLED=0 GOAMD64=v3 GOOS=windows go build -v -trimpath -ldflags '-s -w' -o package-windows-x86-64-v3/ ./cmd/swgp-go
env CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -v -trimpath -ldflags '-s -w' -o package-windows-arm64/ ./cmd/swgp-go
env CGO_ENABLED=0 GOAMD64=v3 GOOS=darwin go build -v -trimpath -ldflags '-s -w' -o package-macos-x86-64-v3/ ./cmd/swgp-go
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -v -trimpath -ldflags '-s -w' -o package-macos-arm64/ ./cmd/swgp-go
- name: Package
env:
ZSTD_CLEVEL: 19
ZSTD_NBTHREADS: 2
run: |
cd package-archlinux-x86-64-v2/
tar -acf ../swgp-go-${{ github.ref_name }}-archlinux-x86-64-v2.tar.zst .
cd ../package-archlinux-x86-64-v3/
tar -acf ../swgp-go-${{ github.ref_name }}-archlinux-x86-64-v3.tar.zst .
cd ../package-linux-x86-64-v2/
tar -acf ../swgp-go-${{ github.ref_name }}-linux-x86-64-v2.tar.zst .
cd ../package-linux-x86-64-v3/
tar -acf ../swgp-go-${{ github.ref_name }}-linux-x86-64-v3.tar.zst .
cd ../package-linux-arm64/
tar -acf ../swgp-go-${{ github.ref_name }}-linux-arm64.tar.zst .
cd ../package-windows-x86-64-v2/
tar -acf ../swgp-go-${{ github.ref_name }}-windows-x86-64-v2.tar.zst .
cd ../package-windows-x86-64-v3/
tar -acf ../swgp-go-${{ github.ref_name }}-windows-x86-64-v3.tar.zst .
cd ../package-windows-arm64/
tar -acf ../swgp-go-${{ github.ref_name }}-windows-arm64.tar.zst .
cd ../package-macos-x86-64-v3/
tar -acf ../swgp-go-${{ github.ref_name }}-macos-x86-64-v3.tar.zst .
cd ../package-macos-arm64/
tar -acf ../swgp-go-${{ github.ref_name }}-macos-arm64.tar.zst .
- name: Upload release assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: swgp-go-*.tar.zst
tag: ${{ github.ref }}
file_glob: true
draft: true