Skip to content

Build

Build #80

Workflow file for this run

name: 'Build'
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-22.04
target: x86_64-unknown-linux-gnu
bundles: appimage,deb
- platform: macos-latest
target: universal-apple-darwin
bundles: app,dmg
- platform: windows-latest
target: x86_64-pc-windows-msvc
bundles: msi
runs-on: ${{ matrix.platform }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
RELEASE_VERSION: ${{ steps.tauri-build.outputs.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: true
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: tauri build
id: tauri-build
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
shell: bash
run: |
pnpm tauri build --ci --target ${{ matrix.target }} --bundles ${{ matrix.bundles }},updater
echo "RELEASE_VERSION=v$(pnpm pkg get version | tr -d \")" >> $GITHUB_OUTPUT
- name: set filenames
shell: bash
run: |
mkdir artifacts
cp src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage artifacts/Lichess-Broadcaster-linux.AppImage || true
cp src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.tar.gz artifacts/Lichess-Broadcaster-linux.AppImage.tar.gz || true
cp src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage.tar.gz.sig artifacts/Lichess-Broadcaster-linux.AppImage.tar.gz.sig || true
cp src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb artifacts/Lichess-Broadcaster-linux.deb || true
cp src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg artifacts/Lichess-Broadcaster-macos.dmg || true
cp src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app.tar.gz artifacts/Lichess-Broadcaster-macos.app.tar.gz || true
cp src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app.tar.gz.sig artifacts/Lichess-Broadcaster-macos.app.tar.gz.sig || true
cp src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi artifacts/Lichess-Broadcaster-windows.msi || true
- name: upload artifact (windows unsigned msi)
id: upload-unsigned-artifact
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: windows-unsigned-msi
path: artifacts/Lichess-Broadcaster-windows.msi
- name: code signing (windows)
id: code-signing
if: matrix.platform == 'windows-latest'
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: '5f88bd6d-9f02-4053-af25-77474c4957e8'
project-slug: 'broadcaster'
signing-policy-slug: ${{ startsWith(github.ref, 'refs/tags/v') && 'release-signing' || 'test-signing' }}
github-artifact-id: ${{ steps.upload-unsigned-artifact.outputs.artifact-id }}
wait-for-completion: true
output-artifact-directory: 'artifacts'
- name: generate updater signature (windows)
if: matrix.platform == 'windows-latest'
shell: bash
run: pnpm tauri signer sign --private-key "${{ secrets.TAURI_PRIVATE_KEY }}" --password "${{ secrets.TAURI_PRIVATE_KEY_PASSWORD }}" artifacts/Lichess-Broadcaster-windows.msi
- name: zip msi for auto-updater (windows)
if: matrix.platform == 'windows-latest'
shell: pwsh
run: Compress-Archive artifacts/Lichess-Broadcaster-windows.msi artifacts/Lichess-Broadcaster-windows.msi.zip
- name: upload release artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.platform }}-${{ matrix.target}}
path: artifacts
publish:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs: build
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: geekyeggo/delete-artifact@v5
with:
name: windows-unsigned-msi
- name: download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: prepare the release files
run: |
mkdir release-files
find artifacts -type f -exec mv {} release-files \;
- name: publish release (if not exists)
run: |
gh release view ${{ needs.build.outputs.RELEASE_VERSION }} || \
gh release create ${{ needs.build.outputs.RELEASE_VERSION }} \
--title "${{ needs.build.outputs.RELEASE_VERSION }}" \
--verify-tag \
--latest \
release-files/*