Skip to content

Build

Build #51

Workflow file for this run

name: 'Build'
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
target: x86_64-apple-darwin
bundles: app,dmg
- platform: macos-latest
target: aarch64-apple-darwin
bundles: app,dmg
- platform: 'ubuntu-22.04'
target: x86_64-unknown-linux-gnu
bundles: appimage,deb
- platform: 'windows-latest'
target: x86_64-pc-windows-msvc
bundles: msi
runs-on: ${{ matrix.platform }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 9
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: upload artifact (windows)
uses: actions/upload-artifact@v4
if: matrix.platform == 'windows-latest'
with:
name: windows-msi-artifact
path: ./src-tauri/target/${{ matrix.target }}/release/bundle/msi/*.msi
- name: code signing (windows)
id: code-signing
if: matrix.platform == 'windows-latest'
uses: signpath/[email protected]
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: '5f88bd6d-9f02-4053-af25-77474c4957e8'
project-slug: 'broadcaster'
signing-policy-slug: 'test-signing'
github-artifact-name: 'windows-msi-artifact'
wait-for-completion: true
output-artifact-directory: 'org/content'
- name: create release
shell: bash
run: |
CREATE_OR_EDIT=$(gh release view ${{ steps.tauri-build.outputs.RELEASE_VERSION }} > /dev/null 2>&1 && echo edit || echo create)
gh release $CREATE_OR_EDIT ${{ steps.tauri-build.outputs.RELEASE_VERSION }} \
--draft \
--prerelease \
--title "Broadcaster ${{ steps.tauri-build.outputs.RELEASE_VERSION }}" \
--notes "See the assets to download this version and install." \
--verify-tag \
--latest
- name: add assets to release (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 }}" \
org/content/*.msi
ls -alR org/content || true
gh release upload ${{ steps.tauri-build.outputs.RELEASE_VERSION }} org/content/* --clobber
- name: add assets to release (linux)
if: matrix.platform == 'ubuntu-22.04'
run: |
gh release upload ${{ steps.tauri-build.outputs.RELEASE_VERSION }} \
./src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage \
./src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage.tar.gz.sig \
./src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb \
--clobber
- name: add assets to release (macos)
if: matrix.platform == 'macos-latest'
run: |
gh release upload ${{ steps.tauri-build.outputs.RELEASE_VERSION }} \
./src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg \
./src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app.tar.gz* \
--clobber