Add snapcraft publish #11
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/release | |
on: push | |
jobs: | |
release: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v1 | |
- name: Install Node.js, NPM | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install Yarn | |
run: npm install -g yarn | |
- name: Setup Python for node-gyp (macOS/Ubuntu only) | |
if: matrix.os != 'windows-latest' | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 # Ensure compatibility with node-gyp | |
- name: Install required dependencies for node-gyp (macOS only) | |
if: matrix.os == 'macos-latest' | |
run: | | |
python3 -m ensurepip --upgrade | |
python3 -m pip install setuptools | |
xcode-select --install || true | |
- name: Install required dependencies for node-gyp (Ubuntu only) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y python3 python3-pip python3-setuptools build-essential | |
- name: Install Snapcraft | |
uses: samuelmeuli/action-snapcraft@v1 | |
# Only install Snapcraft on Ubuntu | |
if: startsWith(matrix.os, 'ubuntu') | |
with: | |
# Log in to Snap Store | |
snapcraft_token: ${{ secrets.snapcraft_token }} | |
- name: Build/release Electron app | |
uses: samuelmeuli/action-electron-builder@v1 | |
with: | |
# GitHub token, automatically provided to the action | |
# (No need to define this secret in the repo settings) | |
github_token: ${{ secrets.gh_token }} | |
# If the commit is tagged with a version (e.g. "v1.0.0"), | |
# release the app after building | |
release: ${{ startsWith(github.ref, 'refs/tags/v') }} |