Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and publish installer artifacts for all platforms | |
on: | |
push: | |
branches: | |
- 'develop' | |
- 'build-linux' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
create_draft_release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: read version from package.json | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@master | |
- name: check for existing release | |
run: gh release list --exclude-drafts | grep -q ".*v${{ steps.package-version.outputs.current-version }}" && exit 1 || true | |
- name: remove old draft releases | |
run: gh release list | grep -e "Draft.*v${{ steps.package-version.outputs.current-version }}" | awk '{print $3}' | xargs -r gh release delete | |
- name: create new draft release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
automatic_release_tag: v${{ steps.package-version.outputs.current-version }} | |
prerelease: false | |
draft: true | |
title: ${{ steps.package-version.outputs.current-version }} | |
build_release: | |
needs: [create_draft_release] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- ubuntu-22.04-arm | |
# include: | |
# - os: macos-13 | |
# cert_key: APPLE_DEVELOPER_SIGNING_CERTIFICATE | |
# cert_password_key: APPLE_CERTIFICATE_PASSWORD | |
# apple_id_key: APPLE_ID | |
# apple_app_specific_password_key: APPLE_ID_PASSWORD | |
# apple_team_id_key: APPLE_TEAM_ID | |
# - os: windows-latest | |
# cert_key: WINDOWS_CSC_CERTIFICATE | |
# cert_password_key: WINDOWS_CSC_PASSWORD | |
runs-on: ${{ matrix.os }} | |
env: | |
CSC_LINK: ${{ secrets[matrix.cert_key] }} | |
CSC_KEY_PASSWORD: ${{ secrets[matrix.cert_password_key] }} | |
APPLE_ID: ${{ secrets[matrix.apple_id_key] }} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets[matrix.apple_app_specific_password_key] }} | |
APPLE_TEAM_ID: ${{ secrets[matrix.apple_team_id_key] }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.12.1 | |
cache: 'npm' | |
- name: Configure arm64 build for Linux | |
if: matrix.os == 'ubuntu-22.04-arm' | |
run: | | |
sed "$((LINE-1)),$((LINE+2))d" electron-builder.json | sed 's/x64/arm64/g' > electron-builder.json.tmp | |
mv electron-builder.json.tmp electron-builder.json | |
- name: install Linux dev tools | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sudo apt update -y | |
sudo apt install -y libudev-dev | |
- name: install Macos dev tools | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
sudo -H pip install setuptools | |
- name: print electron builder config | |
run: cat electron-builder.json | |
- name: create NPM config file | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ./.npmrc | |
- run: npm run setup:ci | |
- run: npm run compile | |
- run: npm run test:unit:main -- --testTimeout=5000 --verbose --detectOpenHandles --forceExit | |
- run: npm run test:unit:components | |
- run: npm run bundle | |
- name: Sleep for 4 seconds | |
shell: bash | |
run: sleep 4 | |
- run: npm run publish |