mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-25 16:09:42 +01:00
80 lines
2.4 KiB
YAML
80 lines
2.4 KiB
YAML
name: Build/release
|
|
|
|
on: workflow_dispatch
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Use Node.js 15.x
|
|
uses: actions/setup-node@v2.1.5
|
|
with:
|
|
node-version: 15.x
|
|
- run: yarn install
|
|
- run: yarn build:desktop
|
|
|
|
- name: Archive build artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: build
|
|
path: build/**/*
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
# Platforms to build on/for
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
|
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Use Node.js 15.x
|
|
uses: actions/setup-node@v2.1.5
|
|
with:
|
|
node-version: 15.x
|
|
|
|
- name: Download notesnook-web build
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: build
|
|
path: ./desktop/build
|
|
|
|
- name: Prepare for app notarization (macOS)
|
|
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
|
|
with:
|
|
package_root: ./desktop
|
|
# GitHub token, automatically provided to the action
|
|
# (No need to define this secret in the repo settings)
|
|
github_token: ${{ secrets.PERSONAL_GH_TOKEN }}
|
|
build_script_name: "build"
|
|
# macOS code signing certificate
|
|
mac_certs: ${{ secrets.mac_certs }}
|
|
mac_certs_password: ${{ secrets.mac_certs_password }}
|
|
|
|
# If the commit is tagged with a version (e.g. "v1.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 }}
|