Skip to content

Release Electron app #20

Release Electron app

Release Electron app #20

Workflow file for this run

# **************************
# Make package of the application
# on multiple OS image (matrix) to generate installer
# **************************
name: Release Electron app
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [
{ name: 'linux', image: 'ubuntu-latest' },
{ name: 'windows', image: 'windows-latest' },
{ name: 'macos/intel', image: 'macos-13' },
{ name: 'macos/M1', image: 'macos-14' },
# { name: 'windows', image: 'windows-latest/x86' },
# { name: 'windows', image: 'windows-latest/x64' },
# { name: 'macos', image: 'macos-13/ || matrix.os.image == 'macos-14'amd64' },
]
runs-on: ${{ matrix.os.image }}
steps:
- name: Github checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: setup python
if: matrix.os.image == 'macos-13' || matrix.os.image == 'macos-14'
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: install setuptools and appdmg
# fix error Error: Cannot find module 'appdmg'
if: matrix.os.image == 'macos-13' || matrix.os.image == 'macos-14'
run: |
python3 -m pip install setuptools --break-system-packages
npm i -g appdmg
- name: Cache node modules
uses: actions/cache@v2
with:
path: 'node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-
- run: npm ci
- name: Debug token
run: echo ${GITHUB_TOKEN:0:3}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Debug APPLE_ID
if: matrix.os.image == 'macos-13' || matrix.os.image == 'macos-14'
run: echo ${APPLE_ID:0:3}
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
- name: Debug APPLE_PASSWORD
if: matrix.os.image == 'macos-13' || matrix.os.image == 'macos-14'
run: echo ${APPLE_PASSWORD:0:3}
env:
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
- name: Debug APPLE_TEAM_ID
if: matrix.os.image == 'macos-13' || matrix.os.image == 'macos-14'
run: echo ${APPLE_TEAM_ID:0:3}
env:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Add MacOS certs
if: matrix.os.image == 'macos-13' || matrix.os.image == 'macos-14'
run: chmod +x add-osx-cert.sh && ./add-osx-cert.sh
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.APPLE_APPLICATION_CERT }}
CERTIFICATE_PASSWORD: ${{ secrets.APPLE_APPLICATION_CERT_PASSWORD }}
- name: Make app
if: matrix.os.image != 'macos-13' || matrix.os.image == 'macos-14'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APPLICATION_CERT: ${{ secrets.APPLE_APPLICATION_CERT }}
KEY_PASSWORD: ${{ secrets.APPLE_APPLICATION_CERT_PASSWORD }}
DEBUG: '@electron/osx-sign,electron-forge:*'
run: npm run make:ci
- name: Make mac app
if: matrix.os.image == 'macos-13' || matrix.os.image == 'macos-14'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_APPLICATION_CERT: ${{ secrets.APPLE_APPLICATION_CERT }}
KEY_PASSWORD: ${{ secrets.APPLE_APPLICATION_CERT_PASSWORD }}
DEBUG: '@electron/osx-sign,electron-forge:*'
run: npm run make:ci:mac
- name: Generate Release.txt
run: echo ${{ github.sha }} > Release.txt
- name: package.json info
id: info
uses: jaywcjlove/github-action-package@main
with:
path: package.json
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release Electron-app ${{ steps.info.outputs.version }}
tag_name: ${{ steps.info.outputs.version }}
files: |
Release.txt
out/**/*.deb
out/**/*.dmg
out/**/*Setup.exe
out/**/*setup.exe
out/**/*.rpm
out/**/*.zip
out/**/*.nupkg
out/**/RELEASES