Builds run on the Gitea runner. Windows is cross-compiled from Linux with cargo-xwin. There is no macOS build because no Mac runner exists.
51 lines
1.8 KiB
YAML
51 lines
1.8 KiB
YAML
name: release
|
|
|
|
# Push a tag like v0.2.0 to build Linux and Windows packages and attach them
|
|
# to a Gitea release of that tag.
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
# AppImage tools need FUSE, which containers lack; this unpacks them instead.
|
|
APPIMAGE_EXTRACT_AND_RUN: "1"
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install tools
|
|
run: scripts/ci-setup.sh --windows
|
|
- name: Take the version from the tag
|
|
run: |
|
|
node -e '
|
|
const fs = require("fs");
|
|
const p = "src-tauri/tauri.conf.json";
|
|
const c = JSON.parse(fs.readFileSync(p));
|
|
c.version = process.env.GITHUB_REF_NAME.replace(/^v/, "");
|
|
fs.writeFileSync(p, JSON.stringify(c, null, 2));
|
|
'
|
|
- name: Unit tests
|
|
run: mise run test
|
|
- name: Build Linux
|
|
run: pnpm tauri build --bundles deb,rpm,appimage
|
|
- name: Build Windows
|
|
run: pnpm tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --bundles nsis
|
|
- name: Collect files
|
|
run: |
|
|
mkdir -p release
|
|
cp src-tauri/target/release/bundle/deb/*.deb release/
|
|
cp src-tauri/target/release/bundle/rpm/*.rpm release/
|
|
cp src-tauri/target/release/bundle/appimage/*.AppImage release/
|
|
cp src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe release/
|
|
cp src-tauri/target/x86_64-pc-windows-msvc/release/gites.exe "release/gites_${GITHUB_REF_NAME#v}_x64_portable.exe"
|
|
ls -la release
|
|
- name: Publish release
|
|
uses: https://gitea.com/actions/release-action@main
|
|
with:
|
|
files: release/*
|
|
api_key: "${{ secrets.GITHUB_TOKEN }}"
|