-
-
Notifications
You must be signed in to change notification settings - Fork 65
78 lines (66 loc) · 2.59 KB
/
main.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
name: main
on: workflow_dispatch
jobs:
build:
strategy:
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Set up checkout
uses: actions/checkout@v4
- name: Set up Yarn cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-cache-
- name: Set up Electron cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.cache/electron
key: ${{ runner.os }}-electron-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-electron-cache-
- name: Set up Electron Builder cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.cache/electron-builder
key: ${{ runner.os }}-electron-builder-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-electron-builder-cache-
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Set up dependencies
run: yarn --ignore-scripts
- name: Lint
run: yarn lint
- name: Create .env file
run: |
touch .env
echo VITE_APP_ELECTRON_STORE_KEY=${{ secrets.ELECTRON_STORE_KEY }} >> .env
echo VITE_APP_SHARE_ENCRYPTION_KEY=${{ secrets.SHARE_ENCRYPTION_KEY }} >> .env
echo VITE_APP_ANONYMOUS_TOKEN=${{ secrets.ANONYMOUS_TOKEN }} >> .env
echo VITE_APP_DISCORD_CLIENT_ID=${{ secrets.DISCORD_CLIENT_ID }} >> .env
echo VITE_APP_SPOTIFY_CLIENT_ID=${{ secrets.SPOTIFY_CLIENT_ID }} >> .env
cat .env
- name: Release
env:
ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron
ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
if ([ ${{ runner.os }} == 'Windows' ]); then
yarn release --win
elif ([ ${{ runner.os }} == 'macOS' ]); then
yarn release --mac
elif ([ ${{ runner.os }} == 'Linux' ]); then
sudo apt install flatpak flatpak-builder libarchive-tools rpm -y
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
yarn release --linux
fi
- name: Clear Wine cache
run: rm -rf ${{ github.workspace }}/.cache/electron-builder/wine