147 lines
4.5 KiB
YAML
147 lines
4.5 KiB
YAML
name: Release Please
|
|
|
|
on:
|
|
push:
|
|
branches: [main] # updates/opens the release PR when commits land on main
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: release-please
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
release-please:
|
|
name: Release Please
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
release_created: ${{ steps.rp.outputs.release_created }}
|
|
release_version: ${{ steps.rp.outputs.version }}
|
|
steps:
|
|
- id: app-token
|
|
uses: actions/create-github-app-token@v2
|
|
with:
|
|
app-id: ${{ secrets.GH_STOAT_RELEASE_APP_ID }}
|
|
private-key: ${{ secrets.GH_STOAT_RELEASE_APP_PRIVATE_KEY }}
|
|
- id: rp
|
|
uses: googleapis/release-please-action@v4
|
|
with:
|
|
token: ${{ steps.app-token.outputs.token }}
|
|
config-file: release-please-config.json
|
|
|
|
publish-release:
|
|
name: Publish App
|
|
needs: release-please
|
|
if: needs.release-please.outputs.release_created == 'true'
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest, macos-26-intel]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Checkout assets
|
|
run: git -c submodule."assets".update=checkout submodule update --init assets
|
|
|
|
- name: Install Flatpak Tooling and Runtimes
|
|
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y flatpak flatpak-builder
|
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
flatpak install -y --user flathub org.freedesktop.Platform//25.08 org.freedesktop.Sdk//25.08
|
|
flatpak install -y --user flathub org.electronjs.Electron2.BaseApp//stable
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
run_install: false
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 26
|
|
cache: "pnpm"
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Publish
|
|
run: |
|
|
pnpm run publish
|
|
env:
|
|
PLATFORM: ${{ matrix.os }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Upload artifact for AppImage build
|
|
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: stoat-linux-package-${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}
|
|
path: ./out/make/zip/linux/${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}/Stoat-linux-*.zip
|
|
|
|
build-appimage:
|
|
needs: [release-please, publish-release]
|
|
if: needs.release-please.outputs.release_created == 'true'
|
|
runs-on: ${{ matrix.runs-on }}
|
|
strategy:
|
|
matrix:
|
|
runs-on: [ubuntu-latest, ubuntu-24.04-arm]
|
|
container: ghcr.io/pkgforge-dev/archlinux:latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Download Artifact
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
name: stoat-linux-package-${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}
|
|
path: /tmp/stoat
|
|
|
|
- name: Preparing Container
|
|
uses: pkgforge-dev/anylinux-setup-action@0964f2258d6c93d1391359978dde081fd8b3c6af # v2
|
|
|
|
- name: Install Dependencies
|
|
run: /bin/sh ./.github/build/appimage/get-dependencies.sh
|
|
|
|
- name: Extract Artifact
|
|
run: /bin/sh ./.github/build/appimage/extract-artifact.sh
|
|
env:
|
|
BUILD_ARCH: ${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}
|
|
BUILD_VERSION: ${{ needs.release-please.outputs.release_version }}
|
|
|
|
- name: Make & Test AppImage
|
|
run: /bin/sh ./.github/build/appimage/make-appimage.sh
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: AppImage-${{ case(matrix.os == 'ubuntu-latest', 'x64', 'arm64') }}
|
|
path: dist
|
|
|
|
publish-appimage:
|
|
runs-on: ubuntu-latest
|
|
needs: [release-please, build-appimage]
|
|
steps:
|
|
- name: Download Artifact
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
pattern: AppImage-*
|
|
merge-multiple: true
|
|
|
|
- name: Update release with AppImage
|
|
run: gh release upload ${{ needs.release-please.outputs.release_version }} Stoat-*.AppImage
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|