-
Notifications
You must be signed in to change notification settings - Fork 32
85 lines (78 loc) · 2.84 KB
/
electron.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
name: "Electron"
on:
release:
types: [created]
jobs:
electron-build:
if: github.actor == 'solcloud'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: "Install Linux dependencies"
timeout-minutes: 3
run: |
sudo apt-get update && sudo apt-get install -y \
npm zip curl
- name: "Install Node dependencies"
timeout-minutes: 3
run: |
cd electron/
npm install
- name: "Build Electron apps"
timeout-minutes: 5
run: |
cd electron/
rm -rf build/
npm run build
zip -r linux.zip build/build-linux*/
zip -r windows.zip build/build-win*/
zip -r macos.zip build/build-mas*/
- name: "Publish Linux Artifact"
timeout-minutes: 5
env:
RELEASE_ID: ${{ github.event.release.id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "release: $RELEASE_ID"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/zip" \
"https://uploads.github.com/repos/solcloud/Counter-Strike/releases/${RELEASE_ID}/assets?name=client-linux.zip" \
--data-binary "@electron/linux.zip"
- name: "Publish Windows Artifact"
timeout-minutes: 5
env:
RELEASE_ID: ${{ github.event.release.id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "release: $RELEASE_ID"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/zip" \
"https://uploads.github.com/repos/solcloud/Counter-Strike/releases/${RELEASE_ID}/assets?name=client-windows.zip" \
--data-binary "@electron/windows.zip"
- name: "Publish MacOS Artifact"
timeout-minutes: 5
env:
RELEASE_ID: ${{ github.event.release.id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "release: $RELEASE_ID"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/zip" \
"https://uploads.github.com/repos/solcloud/Counter-Strike/releases/${RELEASE_ID}/assets?name=client-macos.zip" \
--data-binary "@electron/macos.zip"