Skip to content

Release app

Release app #1

Workflow file for this run

name: Release app
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build-linux:
strategy:
matrix:
os:
[
{ name: 'linux', image: 'ubuntu-latest' }
]
runs-on: ${{ matrix.os.image }}
defaults:
run:
working-directory: ./src/gui
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Use Cargo
uses: dtolnay/rust-toolchain@stable
- name: Install Flatpak dependencies
# Needed to build the Flatpak.
#
# Also, during make, electron-forge will install Electron app dependencies, namely:
# - org.freedesktop.Platform
# - org.freedesktop.SDK
# - org.electronjs.Electron2.BaseApp, and
# - https://github.com/refi64/zypak (yes, it pulls a git repo)
#
# I *would* install them here, but the bundler seems to require a specific version
# and doing it here would be *annoying*.
#
# If you wish to change the version of any of those dependencies, do it in forge.config.ts.
run: |
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder elfutils
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
git config --global protocol.file.allow always
- name: Install dependencies
run: npm install
- name: Build backend
run: npm run build-backend
- name: Publish app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: DEBUG=@malept/flatpak-bundler* npm run publish
build-win:
strategy:
matrix:
os:
[
{ name: 'windows', image: 'windows-latest' }
]
runs-on: ${{ matrix.os.image }}
defaults:
run:
working-directory: ./src/gui
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Use Cargo
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: npm install
- name: Build backend
run: npm run build-backend
- name: Publish app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run publish
build-mac:
strategy:
matrix:
os:
[
{ name: 'macos', image: 'macos-latest' },
{ name: 'macos-x86', image: 'macos-13' },
]
runs-on: ${{ matrix.os.image }}
defaults:
run:
working-directory: ./src/gui
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Use Cargo
uses: dtolnay/rust-toolchain@stable
# https://github.com/electron/forge/issues/3371#issuecomment-2281115374
# setuptools is required to build appdmg (a dependency for creating DMGs).
#
# To install it, we set up a Python environment for both Mac builds and
# install via pip.
- name: Install Python 3.12 (macOS)
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install python-setuptools (macOS)
run: python3 -m pip install setuptools
- name: Install dependencies
run: npm install
- name: Build backend
run: npm run build-backend
- name: Publish app (macOS)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Apps built on M1 are displayed as "damaged" if they're missing a code signature
# (even if they're perfectly fine).
#
# We aren't going to code-sign, but we can "ad-hoc code sign" (give a blank signature)
# to revert it back to the error that's usually seen on Intel Macs
# ("LC3Tools.app" cannot be opened because Apple cannot check it for malicious software.)
#
# This unfortunately complicates the command a bit since we have to apply codesign
# in the middle of the publishing process.
#
# https://github.com/electron-userland/electron-builder/issues/5850#issuecomment-1821648559
run: |
npm run package
codesign --force --deep -s - ./out/*/*.app
npm run publish -- --skip-package