Build electron app #28
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 electron app | |
on: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
build-electron-app: | |
runs-on: ${{ matrix.os }} | |
env: | |
# GitHub token, automatically provided to the action | |
# (No need to define this secret in the repo settings) | |
GH_TOKEN: ${{ secrets.github_token }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Install Node.js and PNPM | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Download certificate file | |
run: | | |
echo $APPLE_DEVELOPER_ID_FILE | base64 --decode >> developer-id.p12 | |
if: matrix.os == 'macos-latest' | |
shell: bash | |
env: | |
APPLE_DEVELOPER_ID_FILE: ${{secrets.BCCM_APPLE_DEVELOPER_ID_FILE}} | |
- name: Build for production | |
run: pnpm build:electron | |
env: | |
NUXT_PUBLIC_APPLICATION_INSIGHTS: ${{ vars.NUXT_PUBLIC_APPLICATION_INSIGHTS }} | |
- name: Package the Electron app for Mac | |
run: pnpm package:electron | |
if: matrix.os == 'macos-latest' | |
env: | |
CSC_LINK: developer-id.p12 | |
CSC_KEY_PASSWORD: ${{secrets.BCCM_APPLE_DEVELOPER_ID_PASSWORD}} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{secrets.BCCM_APPLE_APP_SPECIFIC_PASSWORD}} | |
APPLE_ID: ${{secrets.BCCM_APPLE_ID_USERNAME}} | |
APPLE_ID_PASSWORD: ${{secrets.BCCM_APPLE_APP_SPECIFIC_PASSWORD}} | |
APPLE_TEAM_ID: KJ6LCYQ3A8 | |
- name: Package the Electron app for Linux | |
run: pnpm package:electron | |
if: matrix.os == 'ubuntu-latest' | |
- name: Install AzureSignTool | |
run: dotnet tool install -g AzureSignTool | |
if: matrix.os == 'windows-latest' | |
shell: bash | |
- name: Package the Electron app for Windows | |
run: pnpm package:electron | |
if: matrix.os == 'windows-latest' | |
env: | |
WINDOWS_DIRECTORY_ID: ${{ secrets.BCCM_WINDOWS_DIRECTORY_ID }} | |
WINDOWS_CLIENT_ID: ${{ secrets.BCCM_WINDOWS_CLIENT_ID }} | |
WINDOWS_CLIENT_SECRET: ${{ secrets.BCCM_WINDOWS_CLIENT_SECRET }} | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app | |
path: | | |
dist-app/BMM* | |
- name: Archive Debian packages | |
uses: actions/upload-artifact@v3 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
name: app | |
path: | | |
dist-app/bmm-web*.deb |