-
Notifications
You must be signed in to change notification settings - Fork 10
161 lines (142 loc) · 4.97 KB
/
release_beta.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
name: Release Beta
on:
push:
branches:
- main
issue_comment:
types: [created]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
delete_old_beta:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'issue_comment' || (github.event.issue.number == 69 && contains(github.event.comment.body, '/release-beta')) }}
steps:
- name: Execute Delete Release/Tag action
uses: ShivamHS/delete-tag@v1
with:
token: ${{ secrets.MY_TOKEN }} #generate new PAT and give delete access to it
repo: desktop-release
owner: alist-org
keyword: beta
deletetype: "release" #tag: will delete tags only; release: will delete releases only; tr: will delete both releases and tags
release_beta:
needs: delete_old_beta
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
args:
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
args:
- os: windows-latest
target: x86_64-pc-windows-msvc
args: --bundles nsis,updater
- os: macos-latest
target: aarch64-apple-darwin
args:
- os: windows-latest
target: aarch64-pc-windows-msvc
args: --bundles nsis,updater
# - os: ubuntu-20.04
# target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: alist-dev/desktop
token: ${{ secrets.MY_TOKEN }}
- name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-20.04'
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
# sudo apt-get install -y libssl-dev pkg-config gcc-10-aarch64-linux-gnu
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- uses: pnpm/action-setup@v2
with:
version: 9
run_install: false
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache: "pnpm" # Set this to npm, yarn or pnpm.
- name: Install app dependencies and build web
run: pnpm i
- name: Replace version
run: |
npx tsx ./scripts/beta_version.ts
cat src-tauri/tauri.conf.json
env:
AD_VERSION: ${{ github.ref_name }}
TARGET_TRIPLE: ${{ matrix.target }}
- name: Get Rclone version
id: get-rclone-version
uses: fangqiuming/[email protected]
with:
repository: rclone/rclone
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download sidecar
run: npx tsx ./scripts/bin.ts
env:
TARGET_TRIPLE: ${{ matrix.target }}
ALIST_VERSION: beta
RCLONE_VERSION: ${{ steps.get-rclone-version.outputs.tag_name }} # v1.63.0
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
# PKG_CONFIG_ALLOW_CROSS: ${{ contains(matrix.target, 'aarch64') && '1' || '' }}
with:
# tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
releaseName: "AList Desktop v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version.
releaseBody: "See the assets to download and install this version."
args: "--target ${{ matrix.target }} ${{ matrix.args }}"
prerelease: true
tagName: beta
build_updater:
name: "Build updater beta"
needs: release_beta
environment: ${{ github.event.inputs.environment || 'Beta' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: main
- uses: pnpm/action-setup@v2
with:
version: 9
run_install: false
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: "lts/*"
# cache: "pnpm" # Set this to npm, yarn or pnpm.
- name: Generate proxy.json
run: |
npx tsx ./proxy.ts
- name: Upload proxy.json
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
token: ${{ secrets.MY_TOKEN }}
tag_name: beta
files: |
*.proxy.json