Skip to content

Merge pull request #615 from Thorium-Sim/develop #68

Merge pull request #615 from Thorium-Sim/develop

Merge pull request #615 from Thorium-Sim/develop #68

Workflow file for this run

name: Build/release
on:
push:
branches:
- main
- alpha
- beta
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Dependencies
run: npm install
- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
- name: Archive other artifacts
uses: actions/upload-artifact@v4
with:
name: desktop
path: desktop
- name: Archive package.json
uses: actions/upload-artifact@v4
with:
name: package
path: package.json
release:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
ref: ${{env.GITHUB_REF}}
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 18
- name: Download production artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Download other artifacts
uses: actions/download-artifact@v4
with:
name: desktop
path: desktop
- name: Remove old package.json
run: rm package.json
- name: Download package
uses: actions/download-artifact@v4
with:
name: package
path: "."
- name: Prepare for app notarization
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
if: always()
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.GITHUB_TOKEN }}
mac_certs: ${{ secrets.MAC_CERTS }}
mac_certs_password: ${{ secrets.MAC_CERTS_PASSWORD }}
# Don't worry about running the build, just use electron-builder
skip_build: true
# If the commit is tagged with a version (e.g. "1.0.0"),
# release the app after building
release: true
env:
# macOS notarization API key
API_KEY_ID: ${{ secrets.api_key_id }}
API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup tmate session
uses: mxschmitt/action-tmate@v2
if: failure()