Add Gitea build workflows
This commit is contained in:
@@ -0,0 +1,82 @@
|
|||||||
|
name: Build Linux Packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
TYPST_COMMIT: 44b3f78ed37fedea75e911dde2269ef86c45316f
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: typst-desktop
|
||||||
|
|
||||||
|
- name: Clone Typst compiler
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/typst/typst.git typstdrive/typst
|
||||||
|
git -C typstdrive/typst checkout "$TYPST_COMMIT"
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y \
|
||||||
|
libwebkit2gtk-4.1-dev \
|
||||||
|
libgtk-3-dev \
|
||||||
|
libappindicator3-dev \
|
||||||
|
librsvg2-dev \
|
||||||
|
patchelf \
|
||||||
|
libssl-dev \
|
||||||
|
pkg-config \
|
||||||
|
build-essential \
|
||||||
|
file \
|
||||||
|
curl \
|
||||||
|
wget
|
||||||
|
|
||||||
|
- name: Set up Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Cache cargo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
typst-desktop/src-tauri/target
|
||||||
|
key: cargo-release-${{ hashFiles('typst-desktop/src-tauri/Cargo.lock') }}
|
||||||
|
restore-keys: cargo-release-
|
||||||
|
|
||||||
|
- name: Install frontend dependencies
|
||||||
|
working-directory: typst-desktop
|
||||||
|
run: bun install
|
||||||
|
|
||||||
|
- name: Build application
|
||||||
|
working-directory: typst-desktop
|
||||||
|
run: bun run tauri build
|
||||||
|
|
||||||
|
- name: Collect packages
|
||||||
|
run: |
|
||||||
|
mkdir -p packages
|
||||||
|
find typst-desktop/src-tauri/target/release/bundle \
|
||||||
|
-type f \( -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" \) \
|
||||||
|
-exec cp {} packages/ \;
|
||||||
|
ls -la packages
|
||||||
|
|
||||||
|
- name: Upload packages
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: typst-desktop-linux-x86_64
|
||||||
|
path: packages/*
|
||||||
|
if-no-files-found: error
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
TYPST_COMMIT: 44b3f78ed37fedea75e911dde2269ef86c45316f
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
frontend:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun install
|
||||||
|
|
||||||
|
- name: Type check
|
||||||
|
run: bun run check
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: bun run build
|
||||||
|
|
||||||
|
backend:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: typst-desktop
|
||||||
|
|
||||||
|
- name: Clone Typst compiler
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/typst/typst.git typstdrive/typst
|
||||||
|
git -C typstdrive/typst checkout "$TYPST_COMMIT"
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libssl-dev pkg-config
|
||||||
|
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Cache cargo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
typst-desktop/src-tauri/target
|
||||||
|
key: cargo-${{ hashFiles('typst-desktop/src-tauri/Cargo.lock') }}
|
||||||
|
restore-keys: cargo-
|
||||||
|
|
||||||
|
- name: Check
|
||||||
|
working-directory: typst-desktop/src-tauri
|
||||||
|
run: cargo check
|
||||||
@@ -140,7 +140,13 @@ bun run tauri build
|
|||||||
|
|
||||||
## Distribution
|
## Distribution
|
||||||
|
|
||||||
Installers are built by the `Build and Release` workflow, which runs on every `v*` tag and can also be started manually. It produces a draft GitHub release with an installer for each platform.
|
Workflows live in `.github/workflows` for GitHub Actions and `.gitea/workflows` for Gitea Actions.
|
||||||
|
|
||||||
|
| Workflow | Where | Trigger | Output |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `ci.yml` | both | push, pull requests | Type check, frontend build, backend check. |
|
||||||
|
| `release.yml` | GitHub | `v*` tags, manual | A draft release with installers for every platform. |
|
||||||
|
| `build.yml` | Gitea | `v*` tags, manual | Linux packages as workflow artifacts. |
|
||||||
|
|
||||||
| Platform | Artifacts |
|
| Platform | Artifacts |
|
||||||
|---|---|
|
|---|---|
|
||||||
@@ -148,6 +154,8 @@ Installers are built by the `Build and Release` workflow, which runs on every `v
|
|||||||
| Windows | `.msi`, `-setup.exe` (NSIS) |
|
| Windows | `.msi`, `-setup.exe` (NSIS) |
|
||||||
| macOS | `.dmg` for Apple Silicon and Intel, built separately |
|
| macOS | `.dmg` for Apple Silicon and Intel, built separately |
|
||||||
|
|
||||||
|
Windows and macOS installers come from GitHub Actions because those runners are not available on a self-hosted Gitea instance. The Gitea workflows cover checks and Linux packages.
|
||||||
|
|
||||||
To cut a release:
|
To cut a release:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in New Issue
Block a user