-
Notifications
You must be signed in to change notification settings - Fork 2
208 lines (181 loc) · 7.39 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
name: Release
on:
push:
tags:
- "*.*.*"
jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
# Note this. We are going to use that in further jobs.
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
body: |
Last commit: ${{ github.event.head_commit.message || format('v{0}', github.ref_name) }}
draft: false
prerelease: false
build:
name: Build binaries
needs: create_release
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
- platform: "ubuntu-22.04"
- platform: "windows-latest"
outputs:
windows-signature: ${{steps.updateSignatureWindows.outputs.contents}}
linux-signature: ${{steps.updateSignatureLinux.outputs.contents}}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: 'clippy, rustfmt'
- name: Rust cache
uses: Swatinem/[email protected]
with:
prefix-key: v0-rust-${{ matrix.platform }}
workspaces: "src-tauri -> target"
- name: Install build dependencies (Ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install front-end dependencies
run: |
yarn set version 4.0.2
yarn
- name: Update versions
uses: ./.github/actions/update-versions
with:
version: ${{github.ref_name}}
- name: Write key file
uses: DamianReeves/[email protected]
with:
path: "src-tauri/gk.key"
contents: ${{ secrets.KEYDATA }}
- name: Write env file
uses: DamianReeves/[email protected]
with:
path: "./.env"
contents: |
TAURI_PRIVATE_KEY=gk.key
TAURI_KEY_PASSWORD=${{ secrets.KEYPASS }}
- name: Build
env:
NODE_OPTIONS: "--max-old-space-size=4096"
run: |
yarn tauri build
- name: Upload release (MSI)
if: matrix.platform == 'windows-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: GlacierKit_${{ github.ref_name }}_x64_en-US.msi.zip
asset_path: src-tauri\target\release\bundle\msi\GlacierKit_${{ github.ref_name }}_x64_en-US.msi.zip
asset_content_type: application/octet-stream
- name: Read update signature (Windows)
if: matrix.platform == 'windows-latest'
id: updateSignatureWindows
uses: andstor/[email protected]
with:
path: "src-tauri/target/release/bundle/msi/GlacierKit_${{ github.ref_name }}_x64_en-US.msi.zip.sig"
- name: Upload release (AppImage)
if: matrix.platform == 'ubuntu-22.04'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: GlacierKit_${{ github.ref_name }}_amd64.AppImage.tar.gz
asset_path: src-tauri/target/release/bundle/appimage/glacier-kit_${{ github.ref_name }}_amd64.AppImage.tar.gz
asset_content_type: application/octet-stream
- name: Read update signature (Ubuntu)
if: matrix.platform == 'ubuntu-22.04'
id: updateSignatureLinux
uses: andstor/[email protected]
with:
path: "src-tauri/target/release/bundle/appimage/glacier-kit_${{ github.ref_name }}_amd64.AppImage.tar.gz.sig"
post_release:
name: Post release
needs: build
runs-on: 'ubuntu-22.04'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "main"
fetch-depth: 0
- name: Update versions
uses: ./.github/actions/update-versions
with:
version: ${{github.ref_name}}
- name: Update updates.json version
uses: jossef/action-set-json-field@v2
with:
file: "updates.json"
field: "version"
value: ${{ github.ref_name }}
- name: Update updates.json notes
uses: jossef/action-set-json-field@v2
with:
file: "updates.json"
field: "notes"
value: "${{ github.event.head_commit.message || format('v{0}', github.ref_name) }}"
- name: Update updates.json pub_date
uses: jossef/action-set-json-field@v2
with:
file: "updates.json"
field: "pub_date"
value: ${{ github.event.repository.updated_at}}
- name: Update updates.json signature
uses: jossef/action-set-json-field@v2
with:
file: "updates.json"
field: "platforms.windows-x86_64.signature"
value: ${{ needs.build.outputs.windows-signature }}
- name: Update updates.json URL
uses: jossef/action-set-json-field@v2
with:
file: "updates.json"
field: "platforms.windows-x86_64.url"
value: "https://github.com/atampy25/glacierkit/releases/download/${{ github.ref_name }}/GlacierKit_${{ github.ref_name }}_x64_en-US.msi.zip"
- name: Update updates.json signature
uses: jossef/action-set-json-field@v2
with:
file: "updates.json"
field: "platforms.linux-x86_64.signature"
value: ${{ needs.build.outputs.linux-signature }}
- name: Update updates.json URL
uses: jossef/action-set-json-field@v2
with:
file: "updates.json"
field: "platforms.linux-x86_64.url"
value: "https://github.com/atampy25/glacierkit/releases/download/${{ github.ref_name }}/GlacierKit_${{ github.ref_name }}_amd64.AppImage.tar.gz"
- name: Format configs
run: |
yarn set version 4.0.2
yarn
yarn format-configs
- name: Commit changes
uses: EndBug/[email protected]
with:
default_author: github_actions
message: "Post-update"