This repository has been archived by the owner on Dec 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
162 lines (139 loc) · 5.89 KB
/
build.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
#file: noinspection SpellCheckingInspection
name: Build and Release
on:
release:
types:
- created
env:
node_version: 18
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
- name: Checkout code
uses: actions/checkout@v4
# - name: install maker-flatpak dependencies
# run: |
# sudo apt-get install flatpak -y
# sudo apt-get install flatpak-builder -y
# sudo apt-get install elfutils -y
# sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# sudo flatpak install flathub org.freedesktop.Platform/x86_64/19.08 org.freedesktop.Sdk/x86_64/19.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y
- name: Clear Yarn Cache
run: yarn cache clean
- name: Install dependencies
run: |
corepack enable
yarn
yarn version --no-git-tag-version --new-version ${{ github.event.release.tag_name }}
- name: Build for Linux
run: yarn make --platform linux
- name: Rename output files
run: |
mv out/make/deb/x64/vtt-desktop-client_${{ github.event.release.tag_name }}_amd64.deb ./vtt-desktop-client_${{ github.event.release.tag_name }}_amd64.deb
mv out/make/rpm/x64/vtt-desktop-client-${{ github.event.release.tag_name }}-1.x86_64.rpm ./vtt-desktop-client-${{ github.event.release.tag_name }}-1.x86_64.rpm
mv out/make/zip/linux/x64/vtt-desktop-client-linux-x64-${{ github.event.release.tag_name }}.zip ./vtt-desktop-client-linux-x64-${{ github.event.release.tag_name }}.zip
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: linux-outputs
path: |
vtt-desktop-client_${{ github.event.release.tag_name }}_amd64.deb
vtt-desktop-client-${{ github.event.release.tag_name }}-1.x86_64.rpm
vtt-desktop-client-linux-x64-${{ github.event.release.tag_name }}.zip
# - name: Upload to Flathub
# uses: flatpak/flatpak-github-actions/flat-manager@v4
# with:
# repository: elementary
# flat-manager-url: https://flatpak-api.elementary.io
# token: some_very_hidden_token
# end-of-life: "The application has been renamed to..."
# end-of-life-rebase: "org.zbrown.Palette"
build-macos:
runs-on: macos-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
yarn
yarn version --no-git-tag-version --new-version ${{ github.event.release.tag_name }}
- name: Build for macOS
run: yarn make --platform darwin
- name: Rename output files
run: |
mv out/make/zip/darwin/x64/vtt-desktop-client-darwin-x64-${{ github.event.release.tag_name }}.zip ./vtt-desktop-client-macos-x64-${{ github.event.release.tag_name }}.zip
mv out/make/vtt-desktop-client-${{ github.event.release.tag_name }}-x64.dmg ./vtt-desktop-client-${{ github.event.release.tag_name }}-x64.dmg
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: macos-outputs
path: |
vtt-desktop-client-macos-x64-${{ github.event.release.tag_name }}.zip
vtt-desktop-client-${{ github.event.release.tag_name }}-x64.dmg
build-windows:
runs-on: windows-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
corepack enable
yarn
yarn version --no-git-tag-version --new-version ${{ github.event.release.tag_name }}
- name: Build for Windows
run: yarn make --platform win32
- name: Rename output files
run: |
Move-Item -Path "out\make\squirrel.windows\x64\vtt-desktop-client-${{ github.event.release.tag_name }} Setup.exe" -Destination ".\vtt-desktop-client-windows-x64-${{ github.event.release.tag_name }}-setup.exe"
Move-Item -Path "out\make\zip\win32\x64\vtt-desktop-client-win32-x64-${{ github.event.release.tag_name }}.zip" -Destination ".\vtt-desktop-client-windows-x64-portable-${{ github.event.release.tag_name }}.zip"
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: windows-outputs
path: |
vtt-desktop-client-windows-x64-${{ github.event.release.tag_name }}-setup.exe
vtt-desktop-client-windows-x64-portable-${{ github.event.release.tag_name }}.zip
publish:
needs:
- build-linux
- build-macos
- build-windows
runs-on: ubuntu-latest
steps:
- name: Download linux production artifacts for publication
uses: actions/download-artifact@v2
with:
name: linux-outputs
path: linux-outputs
- name: Download windows production artifacts for publication
uses: actions/download-artifact@v2
with:
name: windows-outputs
path: windows-outputs
- name: Download macos production artifacts for publication
uses: actions/download-artifact@v2
with:
name: macos-outputs
path: macos-outputs
- name: Create release
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: ${{ github.event.release.name }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "./linux-outputs/*, ./windows-outputs/*, ./macos-outputs/*"
body: ${{ github.event.release.body }}