forked from lutzroeder/netron
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (85 loc) · 3.15 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
name: Publish
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
jobs:
publish:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Git credentials
run: |
git config --global user.name ${{ secrets.PUBLISH_USER_NAME }}
git config --global user.email ${{ secrets.PUBLISH_USER_EMAIL }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: latest
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install npm packages
run: npm install
- name: Lint
run: npm run lint
- name: Publish Electron
shell: bash
if: github.repository == 'lutzroeder/netron'
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
API_KEY_ID: ${{ secrets.API_KEY_ID }}
API_KEY_ISSUER_ID: ${{ secrets.API_KEY_ISSUER_ID }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
npx electron-builder install-app-deps
case "${{ matrix.os }}" in
macos*)
mkdir -p ~/.private_keys
echo '${{ secrets.API_KEY }}' > ~/.private_keys/AuthKey_${{ secrets.API_KEY_ID }}.p8
npx electron-builder --mac --universal --publish always
;;
ubuntu*)
sudo snap install snapcraft --classic
npx electron-builder --linux appimage --x64 --publish always
npx electron-builder --linux snap --x64 --publish always
;;
windows*)
unset CSC_LINK;
unset CSC_KEY_PASSWORD;
npx electron-builder --win --x64 --arm64 --publish always
;;
esac
- if: github.repository == 'lutzroeder/netron' && startsWith(matrix.os, 'ubuntu')
name: Publish Python
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_api_token }}
run: npm run publish python
- if: startsWith(matrix.os, 'ubuntu')
name: Publish Web
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
GITHUB_USER: ${{ secrets.PUBLISH_GITHUB_USER }}
run: npm run publish web
- if: github.repository == 'lutzroeder/netron' && startsWith(matrix.os, 'macos')
name: Publish cask
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
GITHUB_USER: ${{ secrets.PUBLISH_GITHUB_USER }}
run: npm run publish cask
- if: github.repository == 'lutzroeder/netron' && startsWith(matrix.os, 'windows')
name: Publish winget
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
GITHUB_USER: ${{ secrets.PUBLISH_GITHUB_USER }}
run: npm run publish winget