-
-
Notifications
You must be signed in to change notification settings - Fork 35
224 lines (217 loc) · 7.24 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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: build-and-release
on:
push:
branches:
- unstable
- main
tags:
- v*
pull_request:
branches:
- main
- unstable
- development
permissions:
contents: read
jobs:
macapp-test:
# description: "Builds and signs a macOS app then packages it in a notarized DMG."
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable'
name: Make macOS DMG
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
# we need the whole thing so we can count commits.
fetch-depth: '0'
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: go-generate
run: go generate ./...
- name: make-signdmg
env:
APPLE_SIGNING_KEY: ${{ secrets.APPLE_SIGNING_KEY }}
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
SLIPPERS: ${{ secrets.SLIPPERS }}
id: release
run: |
brew install Bearer/tap/gon
[ -z SLIPPERS ] || eval "${SLIPPERS}"
gzip -9 pkg/bindata/files/{css,js}/*
gzip -9r pkg/bindata/templates/*
make signdmg
- name: Upload DMG Artifact
uses: actions/upload-artifact@v4
with:
name: dmg-release
path: release
release:
# description: "Builds all the Notifiarr client binaries and packages for a release."
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable' || github.ref == 'refs/heads/main'
outputs:
version: ${{ steps.vars.outputs.version }}
revision: ${{ steps.vars.outputs.revision }}
name: Make Release Assets
runs-on: ubuntu-latest
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
SLIPPERS: ${{ secrets.SLIPPERS }}
steps:
- uses: actions/checkout@v4
with:
# we need the whole thing so we can count commits.
fetch-depth: '0'
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Get Version and Iteration
id: vars
run: |
source settings.sh
echo "Building v${VERSION}-${ITERATION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "revision=${ITERATION}" >> $GITHUB_OUTPUT
- name: Make Release v${{steps.vars.outputs.version}}-${{steps.vars.outputs.revision}}
id: release
run: |
sudo apt install -y rpm fakeroot zip debsigs gnupg jq libarchive-tools
sudo gem install --no-document fpm
echo "${GPG_SIGNING_KEY}" | gpg --import -
[ -z SLIPPERS ] || eval "${SLIPPERS}"
gzip -9 pkg/bindata/files/{css,js}/*
gzip -9r pkg/bindata/templates/*
make release
- name: Upload Release Artifacts v${{steps.vars.outputs.version}}-${{steps.vars.outputs.revision}}
uses: actions/upload-artifact@v4
with:
name: release
path: release
- name: upload sha512sums.txt
uses: actions/upload-artifact@v4
with:
name: sha512sums.txt
path: release/sha512sums.txt
print-built-version:
needs:
- release
name: Built v${{needs.release.outputs.version}}-${{needs.release.outputs.revision}}
runs-on: ubuntu-latest
steps:
- name: Built v${{needs.release.outputs.version}}-${{needs.release.outputs.revision}}
run: echo Built v${{needs.release.outputs.version}}-${{needs.release.outputs.revision}}
deploy-unstable-unstable:
# description: "Uploads pre-built binaries to unstable.golift.io."
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable'
strategy:
matrix:
files: [release, dmg-release]
needs:
- release
- macapp-test
name: GoLift Unstable Deploy
runs-on: ubuntu-latest
steps:
- name: "Download files: ${{ matrix.files }}"
uses: actions/download-artifact@v4
with:
name: ${{ matrix.files }}
- name: Upload files to unstable.golift.io
run: >-
for file in *.{zip,dmg,gz}; do
[ -f "$file" ] || continue;
echo "Uploading: ${file}";
curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=notifiarr" -F "file=@${file}";
echo '{"version":"${{needs.release.outputs.version}}","revision":${{needs.release.outputs.revision}},"size":'$(stat --printf="%s" ${file})'}' >> ${file}.txt
curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=notifiarr" -F "file=@${file}.txt";
done
deploy-unstable-packagecloud:
# description: "Uploads pre-built RPM and DEB packages to packagecloud.io/golift"
if: github.ref == 'refs/heads/unstable'
needs:
- release
name: PackageCloud Unstable Deploy
runs-on: ubuntu-latest
steps:
- name: Download release files
uses: actions/download-artifact@v4
with:
name: release
- uses: golift/upload-packagecloud@v1
with:
userrepo: golift/unstable
apitoken: ${{ secrets.PACKAGECLOUD_TOKEN }}
packages: .
rpmdists: el/6
debdists: ubuntu/focal
deploy-packagecloud:
# description: "Uploads pre-built RPM and DEB packages to packagecloud.io/golift"
if: startsWith(github.ref, 'refs/tags/v')
needs:
- release
name: PackageCloud Release Deploy
runs-on: ubuntu-latest
steps:
- name: Download release files
uses: actions/download-artifact@v4
with:
name: release
- uses: golift/upload-packagecloud@v1
with:
userrepo: golift/pkgs
apitoken: ${{ secrets.PACKAGECLOUD_TOKEN }}
packages: .
rpmdists: el/6
debdists: ubuntu/focal
deploy-github:
# description: uploads all the built release assets to the GitHub Release.
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
needs:
- release
- macapp-test
strategy:
matrix:
files: [release, dmg-release]
name: Deploy GitHub Release
runs-on: ubuntu-latest
steps:
- name: Download ${{ matrix.files }} Files
uses: actions/download-artifact@v4
with:
name: ${{ matrix.files }}
- name: Publish ${{ matrix.files }} artifacts to github
uses: softprops/action-gh-release@v2
with:
files: |
*.rpm
*.deb
*.txz
*.zip
*.dmg
*.gz
*.txt
*.zst
*.sig
archlinux-aur:
if: startsWith(github.ref, 'refs/tags/v')
# description: creates and uploads a PKGBUILD file to the official aur repo from Arch Linux.
needs:
- release
name: Deploy ArchLinux AUR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Download ${{ matrix.files }} Files
uses: actions/download-artifact@v4
with:
name: sha512sums.txt
- name: Deploy Aurch AUR
run: bash init/archlinux/aur-deploy.sh
env:
DEPLOY_KEY: ${{ secrets.AUR_DEPLOY_KEY }}