-
-
Notifications
You must be signed in to change notification settings - Fork 29
85 lines (74 loc) · 2.64 KB
/
prod-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
name: ProductionPublish
on:
push:
branches:
- release/*
workflow_dispatch:
jobs:
publish:
# all published versions are considered "staging" until we release a non-alpha version
environment: prod
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: Install packages for building
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install --no-install-recommends -y rpm libarchive-tools
else
exit 0
fi
- name: Used variables
run: |
echo "MP_PROJECT_ENV variable : ${{ vars.MP_PROJECT_ENV }}"
echo "NICENODE_ENV variable : ${{ vars.NICENODE_ENV }}"
- name: Checkout git repo
uses: actions/checkout@v4
- name: Install Node and NPM
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: |
npm install
# This dependency wasn't needed until suddenly on Dec. 2, 2022
- name: install dmg-license
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
npm i -D dmg-license
else
exit 0
fi
shell: bash
- name: Publish releases
env:
# These values are used for auto updates signing
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
WIN_CSC_LINK: ${{ secrets.WIN_CSC_BASE64 }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD_2 }}
# CSC_IDENTITY_AUTO_DISCOVERY: false
# This is used for app event tracking
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
MP_PROJECT_TOKEN: ${{ secrets.MP_PROJECT_TOKEN }}
MP_PROJECT_ENV: ${{ vars.MP_PROJECT_ENV }}
NICENODE_ENV: ${{ vars.NICENODE_ENV }}
# This is used for uploading release assets to github
GH_TOKEN: ${{ secrets.GH_TOKEN }}
# This is used for publishing snap release assets to snapcraft
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
npm run postinstall
npm run build
if [ "$RUNNER_OS" == "macOS" ]; then
npm exec electron-builder -- --publish always --win --mac
else
npm exec electron-builder -- --publish always --linux
fi