-
Notifications
You must be signed in to change notification settings - Fork 2
155 lines (130 loc) · 5.4 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
name: Release
on:
push:
tags:
- "*.*.*"
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
if: github.event.action != 'push' || startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
with:
ref: "main"
fetch-depth: 0
- name: Get latest tag
id: latestTag
uses: "WyriHaximus/[email protected]"
with:
fallback: unknown
- name: Prepare Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: x86_64-pc-windows-msvc
default: true
components: clippy, rustfmt
- name: Rust cache
uses: Swatinem/[email protected]
with:
workspaces: "src-tauri -> target"
- name: Install dependencies
run: |
yarn set version 4.0.2
yarn
- name: Update package.json version
uses: jossef/action-set-json-field@v2
with:
file: "package.json"
field: "version"
value: ${{ steps.latestTag.outputs.tag }}
- name: Update Cargo.toml version
uses: colathro/[email protected]
with:
file: "src-tauri/Cargo.toml"
key: "package.version"
value: ${{ steps.latestTag.outputs.tag }}
- name: Update tauri.conf.json version
uses: jossef/action-set-json-field@v2
with:
file: "src-tauri/tauri.conf.json"
field: "package.version"
value: ${{ steps.latestTag.outputs.tag }}
- name: Update updates.json version
uses: jossef/action-set-json-field@v2
with:
file: "updates.json"
field: "version"
value: ${{ steps.latestTag.outputs.tag }}
- 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}', steps.latestTag.outputs.tag) }}"
- 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: 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: Remove key file
run: |
Remove-Item "src-tauri/gk.key"
- name: Remove env file
run: |
Remove-Item "./.env"
- name: Read update signature
id: updateSignature
uses: andstor/[email protected]
with:
path: "src-tauri/target/release/bundle/msi/GlacierKit_${{ steps.latestTag.outputs.tag }}_x64_en-US.msi.zip.sig"
- name: Update updates.json signature
uses: jossef/action-set-json-field@v2
with:
file: "updates.json"
field: "platforms.windows-x86_64.signature"
value: ${{ steps.updateSignature.outputs.contents }}
- 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/${{ steps.latestTag.outputs.tag }}/GlacierKit_${{ steps.latestTag.outputs.tag }}_x64_en-US.msi.zip"
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.latestTag.outputs.tag }}
body: |
Last commit: ${{ github.event.head_commit.message || format('v{0}', steps.latestTag.outputs.tag) }}
No additional scripts or manual steps are required; just download the MSI installer and run it.
tag_name: ${{ steps.latestTag.outputs.tag }}
repository: atampy25/glacierkit
files: |
src-tauri/target/release/bundle/msi/GlacierKit_${{ steps.latestTag.outputs.tag }}_x64_en-US.msi.zip
- name: Format configs
run: |
yarn format-configs
- name: Commit changes
uses: EndBug/[email protected]
with:
default_author: github_actions
message: "Post-update"