Skip to content

Merge pull request #3344 from Thorium-Sim/develop #116

Merge pull request #3344 from Thorium-Sim/develop

Merge pull request #3344 from Thorium-Sim/develop #116

Workflow file for this run

name: Build/release
on:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.config/yarn/global # npm cache files are stored in `~/.npm` on Linux/macOS
key:
${{ runner.os }}-build-${{ env.cache-name }}-${{
hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: yarn
- name: Semantic Release
run: |
npm run semantic-release
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: build
release:
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [macos-12, windows-2019]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
ref: "main"
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
- uses: actions/setup-python@v4
if: startsWith(matrix.os, 'macos')
with:
python-version: "3.9" # Needed for the older version of Node Gyp
- name: Download production artifacts
uses: actions/download-artifact@v2
with:
name: build
path: build
- 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_cert }}
mac_certs_password: ${{ secrets.mac_cert_password }}
# Don't worry about
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 }}
ENGINE_API_KEY: ${{ secrets.ENGINE_API_KEY }}
ERROR_REPORTING_ORGANIZATION:
${{ secrets.ERROR_REPORTING_ORGANIZATION }}
ERROR_REPORTING_PROJECT: ${{ secrets.ERROR_REPORTING_PROJECT }}
ERROR_REPORTING_API_TOKEN: ${{ secrets.ERROR_REPORTING_API_TOKEN }}
GOOGLE_SHEETS_PROJECT_ID: ${{ secrets.GOOGLE_SHEETS_PROJECT_ID }}
GOOGLE_SHEETS_SECRET: ${{ secrets.GOOGLE_SHEETS_SECRET }}
GOOGLE_SHEETS_CLIENT_ID: ${{ secrets.GOOGLE_SHEETS_CLIENT_ID }}
GH_ISSUE_TOKEN: ${{ secrets.GH_ISSUE_TOKEN }}
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v2
# if: failure()
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v2
# if: failure()