Skip to content

StagingPublish

StagingPublish #1

name: StagingPublish
on:
# push:
# branches:
# - main
workflow_dispatch:
jobs:
publish:
# all published versions are considered "staging" until we release a non-alpha version
environment: staging
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