forked from jupyterlab/jupyterlab-desktop
-
Notifications
You must be signed in to change notification settings - Fork 5
222 lines (195 loc) · 7.75 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: Publish
on:
push:
branches: [master]
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
jobs:
publish:
strategy:
matrix:
cfg:
- { platform: linux, platform_name: Linux, os: ubuntu-latest }
- { platform: mac, platform_name: macOS, os: macos-latest }
- { platform: win, platform_name: Windows, os: windows-latest }
name: '${{ matrix.cfg.platform_name }} installer'
runs-on: ${{ matrix.cfg.os }}
defaults:
run:
# needed for conda to work
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: true
activate-environment: ''
channels: conda-forge
# upgrade conda since v22.11.1 is causing issues in "Install dependencies" step
- run: conda install -c conda-forge conda=24.5.0 python=3.10 -y
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
- name: Install dependencies
# pin Pillow version to prevent Windows build errors
run: |
npm install --global yarn --prefer-offline
yarn install
- name: Check JupyterLab version match
run: |
yarn check_version_match
- name: Check Lint & Prettier
run: |
yarn lint:check
- name: Get package info
shell: bash
id: package-info
run: echo "version=$(python scripts/get_package_version.py)" >> $GITHUB_OUTPUT
- name: 'Find Release with tag v${{ steps.package-info.outputs.version}}'
uses: actions/github-script@v6
id: release-exists
env:
APP_VERSION: ${{ steps.package-info.outputs.version}}
with:
script: |
const releases = await github.rest.repos.listReleases({
owner: '${{ github.repository_owner }}',
repo: '${{ github.repository }}'.split('/')[1]
})
const tagName = `v${process.env.APP_VERSION}`
const releaseWithTag = releases.data.find(release => release.tag_name === tagName && (release.draft || release.prerelease))
return releaseWithTag ? 'true' : 'false'
result-encoding: string
- name: Create Application Installer for Test
env:
CSC_IDENTITY_AUTO_DISCOVERY: false # disable code signing if not release asset
run: |
yarn dist:${{ matrix.cfg.platform }}
if: steps.release-exists.outputs.result == 'false'
- name: Create Application Installer for Release
env:
CSC_IDENTITY_AUTO_DISCOVERY: true # disable code signing if not release asset
CSC_FOR_PULL_REQUEST: true
APPLEID: ${{ secrets.APPLEID }}
APPLEIDPASS: ${{ secrets.APPLEIDPASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.CSC_LINK }}
run: |
set env DEBUG=electron-builder
yarn dist:${{ matrix.cfg.platform }}
if: steps.release-exists.outputs.result == 'true'
- name: Upload Debian Installer
if: matrix.cfg.platform == 'linux'
uses: actions/upload-artifact@v3
with:
name: debian-installer
path: |
dist/NeurodeskApp.deb
- name: Upload Fedora Installer
if: matrix.cfg.platform == 'linux'
uses: actions/upload-artifact@v3
with:
name: fedora-installer
path: |
dist/NeurodeskApp.rpm
- name: Upload macOS x64 Installer
if: matrix.cfg.platform == 'mac'
uses: actions/upload-artifact@v3
with:
name: mac-installer-x64
path: |
dist/NeurodeskApp-x64.dmg
- name: Upload macOS arm64 Installer
if: matrix.cfg.platform == 'mac'
uses: actions/upload-artifact@v3
with:
name: mac-installer-arm64
path: |
dist/NeurodeskApp-arm64.dmg
- name: Upload Windows Installer
if: matrix.cfg.platform == 'win'
uses: actions/upload-artifact@v3
with:
name: windows-installer
path: |
dist/NeurodeskApp-Setup.exe
- name: Upload Debian Installer as Release asset
if: matrix.cfg.platform == 'linux' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/NeurodeskApp.deb
asset_name: NeurodeskApp-Setup-Debian.deb
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload Fedora Installer as Release asset
if: matrix.cfg.platform == 'linux' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/NeurodeskApp.rpm
asset_name: NeurodeskApp-Setup-Fedora.rpm
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload macOS x64 Installer as Release asset
if: matrix.cfg.platform == 'mac' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/NeurodeskApp-x64.dmg
asset_name: NeurodeskApp-Setup-macOS-x64.dmg
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload macOS arm64 Installer as Release asset
if: matrix.cfg.platform == 'mac' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/NeurodeskApp-arm64.dmg
asset_name: NeurodeskApp-Setup-macOS-arm64.dmg
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload macOS x64 App as Release asset
if: matrix.cfg.platform == 'mac' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/NeurodeskApp-x64.zip
asset_name: NeurodeskApp-macOS-x64.zip
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload macOS arm64 App as Release asset
if: matrix.cfg.platform == 'mac' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/NeurodeskApp-arm64.zip
asset_name: NeurodeskApp-macOS-arm64.zip
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload Windows Installer as Release asset
if: matrix.cfg.platform == 'win' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/NeurodeskApp-Setup.exe
asset_name: NeurodeskApp-Setup-Windows.exe
tag: v${{ steps.package-info.outputs.version}}
overwrite: true
- name: Upload latest.yml Release asset
if: matrix.cfg.platform == 'win' && steps.release-exists.outputs.result == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/latest.yml
asset_name: latest.yml
tag: v${{ steps.package-info.outputs.version}}
overwrite: true