-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (139 loc) · 4.32 KB
/
publish.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
name: Publish (Electron + Tauri)
on:
workflow_dispatch:
push:
branches:
- main
permissions: write-all
jobs:
create_release:
name: Create a Release
outputs:
release_id: ${{ steps.create-release.outputs.result }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Dependencies
run: pnpm install
- name: Get Release Data
id: create-release
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const version = await (await import("./index.mjs"))();
console.log(`Version: ${version}`);
return version;
env:
token: ${{ secrets.GITHUB_TOKEN }}
publish_tauri:
name: Build the Tauri App
needs: create_release
strategy:
matrix:
os: [Windows-Latest, Ubuntu-Latest, Macos-Latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Deps
run: pnpm install
working-directory: tauri
- name: install dependencies (ubuntu only)
if: matrix.os == 'Ubuntu-Latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Build Tauri App
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.create_release.outputs.release_id }}
- name: Release Zip Asset
run: node upload.cjs
if: matrix.os == 'Windows-Latest'
working-directory: tauri
env:
releaseid: ${{ needs.create_release.outputs.release_id }}
token: ${{ secrets.GITHUB_TOKEN }}
publish_electron:
name: Build the Electron App
needs: create_release
strategy:
matrix:
os: [Windows-Latest, Ubuntu-Latest, Macos-Latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Deps
run: pnpm install
working-directory: electron
- name: Build
run: pnpm build
working-directory: electron
- name: Get & Release Assets
run: node upload.cjs
working-directory: electron
env:
releaseid: ${{ needs.create_release.outputs.release_id }}
token: ${{ secrets.GITHUB_TOKEN }}
post_builders:
name: Release to GitHub Releases
needs: [create_release, publish_electron, publish_tauri]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
- name: Install npm deps
run: npm install
- name: Setup Rust
run: rustup toolchain install stable
- name: Install CLI
run: cargo install ahqstore_cli_rs
- name: Release App
uses: actions/github-script@v7
env:
token: ${{ secrets.GITHUB_TOKEN }}
release_id: ${{ needs.create_release.outputs.release_id }}
with:
script: |
await (await import("./index.mjs")).release();
- name: Build .ahqstore (Electron)
run: ahqstore upload
env:
APP_ID: U4StnJPm5ssnwpDZHZn4
RELEASE_ID: ${{ needs.create_release.outputs.release_id }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
- name: Build .ahqstore (Tauri)
run: ahqstore upload
env:
APP_ID: jIvEpRUUzlqFWC2Wb404
RELEASE_ID: ${{ needs.create_release.outputs.release_id }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}