-
Notifications
You must be signed in to change notification settings - Fork 14
143 lines (132 loc) · 4.79 KB
/
release.yml
File metadata and controls
143 lines (132 loc) · 4.79 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Create Release
on:
release:
types: [created]
jobs:
build:
permissions:
contents: write
strategy:
matrix:
# Include amd64 on all platforms.
goos:
# - windows
- freebsd
- openbsd
- linux
# - darwin
goarch: [amd64, 386]
gotoolchain: [""]
patch-assetname: [""]
# exclude:
include:
# BEGIN MacOS ARM64
# - goos: darwin
# goarch: arm64
# END MacOS ARM64
# BEGIN Linux ARM 5 6 7
- goos: linux
goarch: arm
goarm: 7
- goos: linux
goarch: arm
goarm: 6
- goos: linux
goarch: arm
goarm: 5
# END Linux ARM 5 6 7
# Windows ARM
# - goos: windows
# goarch: arm64
# - goos: windows
# goarch: arm
# goarm: 7
# BEGIN Other architectures
# BEGIN ARM64
- goos: linux
goarch: arm64
# END ARM64
#BEGIN riscv64 & LOONG64
# - goos: linux
# goarch: riscv64
# - goos: linux
# goarch: loong64
# END riscv64 & LOONG64
# BEGIN MIPS
# - goos: linux
# goarch: mips64
# - goos: linux
# goarch: mips64le
# - goos: linux
# goarch: mipsle
# - goos: linux
# goarch: mips
# END MIPS
# BEGIN PPC
# - goos: linux
# goarch: ppc64
# - goos: linux
# goarch: ppc64le
# END PPC
# BEGIN FreeBSD ARM
- goos: freebsd
goarch: arm64
- goos: freebsd
goarch: arm
goarm: 7
# END FreeBSD ARM
# BEGIN S390X
- goos: linux
goarch: s390x
# END S390X
# END Other architectures
# BEGIN OPENBSD ARM
- goos: openbsd
goarch: arm64
# - goos: openbsd
# goarch: arm
# goarm: 7
# END OPENBSD ARM
fail-fast: false
runs-on: ubuntu-latest
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
CGO_ENABLED: 0
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Show workflow information
run: |
_GOARM="${GOARM:-""}"
if [ -n "$_GOARM" ]; then
_NAME="${GOOS}-${GOARCH}-${_GOARM}"
else
_NAME="${GOOS}-${GOARCH}"
fi
echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV
echo "BINARY_NAME=pasarguard-node-${_NAME}" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26.1"
check-latest: true
- name: Get project dependencies
run: make deps
- name: Build binary and zip
run: |
make
find . -type f -name "pasarguard-node*" -exec mv {} "./pasarguard-node-${{ env.ASSET_NAME }}" \;
# Create zip file with max compression and include README & LICENSE
zip -9 "./pasarguard-node-${{ env.ASSET_NAME }}.zip" "./pasarguard-node-${{ env.ASSET_NAME }}" README.md LICENSE
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./pasarguard-node-${{ env.ASSET_NAME }}.zip
asset_name: pasarguard-node-${{ env.ASSET_NAME }}.zip
asset_content_type: application/zip