Files
typst-desktop/.github/workflows/release.yml
T
2026-07-18 20:43:06 -04:00

112 lines
3.3 KiB
YAML

name: Build and Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Release tag to publish, for example v1.0.0"
required: false
env:
TYPST_COMMIT: 44b3f78ed37fedea75e911dde2269ef86c45316f
APPIMAGE_EXTRACT_AND_RUN: 1
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-22.04
target: ""
label: linux-x86_64
- platform: windows-latest
target: ""
label: windows-x86_64
- platform: macos-latest
target: aarch64-apple-darwin
label: macos-aarch64
- platform: macos-latest
target: x86_64-apple-darwin
label: macos-x86_64
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: typst-desktop
- name: Clone Typst compiler
shell: bash
run: |
git clone https://github.com/typst/typst.git typstdrive/typst
git -C typstdrive/typst checkout "$TYPST_COMMIT"
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
workspaces: typst-desktop/src-tauri
key: ${{ matrix.label }}
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libgtk-3-dev \
build-essential \
curl \
wget \
file \
libssl-dev
- name: Install frontend dependencies
working-directory: typst-desktop
run: bun install
- name: Build application
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: typst-desktop
tagName: ${{ github.ref_type == 'tag' && github.ref_name || inputs.version }}
releaseName: Typst Desktop ${{ github.ref_type == 'tag' && github.ref_name || inputs.version }}
releaseBody: "Download the installer for your platform below."
releaseDraft: true
prerelease: false
args: ${{ matrix.target && format('--target {0}', matrix.target) || '' }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: typst-desktop-${{ matrix.label }}
path: |
typst-desktop/src-tauri/target/release/bundle/**/*.deb
typst-desktop/src-tauri/target/release/bundle/**/*.rpm
typst-desktop/src-tauri/target/release/bundle/**/*.AppImage
typst-desktop/src-tauri/target/release/bundle/**/*.dmg
typst-desktop/src-tauri/target/release/bundle/**/*.msi
typst-desktop/src-tauri/target/release/bundle/**/*.exe
typst-desktop/src-tauri/target/*/release/bundle/**/*.dmg
if-no-files-found: ignore