Add Windows cross-build and Gitea release; share CI setup

- just windows-deps / windows / package-windows: cross-compile with Odin
  objects + lld-link against an xwin SDK, static VC runtime
- Release workflow runs on v* tags, builds Linux and Windows packages,
  uploads them to the package registry and creates a Gitea release
- Shared toolchain setup as a local composite action

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SansanandClaude Opus 5.5 committed 2026-10-01 21:27:22 +02:00
1 parent 9ee2eabe9a
commit e893c45d4f
6 files changed
+165 -66

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
#
# .gitea/actions/setup/action.yaml
#
# Installs the toolchain shared by all workflows: system packages, Odin and just.
#
name: "Setup Odin toolchain"
description: "Install system packages, Odin and just"
inputs:
odin-version:
description: "Odin release tag (keep in sync with odin_version in the justfile)"
default: "dev-2026-09"
packages:
description: "Extra apt packages to install"
default: ""
runs:
using: "composite"
steps:
- name: Install System Packages
shell: bash
run: |
SUDO=""; command -v sudo >/dev/null && SUDO=sudo
$SUDO apt-get update
# clang links Odin programs on Linux; raylib needs X11
$SUDO apt-get install -y --no-install-recommends \
clang libx11-dev curl ca-certificates unzip ${{ inputs.packages }}
- name: Install Odin
shell: bash
run: |
curl -fsSL -o /tmp/odin.tar.gz \
https://github.com/odin-lang/Odin/releases/download/${{ inputs.odin-version }}/odin-linux-amd64-${{ inputs.odin-version }}.tar.gz
mkdir -p "$HOME/odin"
tar -xzf /tmp/odin.tar.gz -C "$HOME/odin" --strip-components=1
echo "$HOME/odin" >> "$GITHUB_PATH"
- name: Install just
shell: bash
run: |
mkdir -p "$HOME/.local/bin"
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
+3 -23
View File
@@ -1,7 +1,7 @@
#
# .gitea/workflows/gitea-build.yaml
#
# Builds and tests on every push and pull request to main and develop.
# Checks, tests and builds on every push and pull request to main and develop.
#
name: "Build and Test"
@@ -11,9 +11,6 @@ on:
pull_request:
branches: [main, develop]
env:
ODIN_VERSION: dev-2026-09
jobs:
build:
runs-on: ubuntu-latest
@@ -21,25 +18,8 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install System Dependencies
run: |
SUDO=""; command -v sudo >/dev/null && SUDO=sudo
$SUDO apt-get update
# clang links Odin programs; raylib needs X11 on Linux
$SUDO apt-get install -y --no-install-recommends clang libx11-dev curl ca-certificates
- name: Install Odin
run: |
curl -fsSL -o odin.tar.gz https://github.com/odin-lang/Odin/releases/download/$ODIN_VERSION/odin-linux-amd64-$ODIN_VERSION.tar.gz
mkdir -p "$HOME/odin"
tar -xzf odin.tar.gz -C "$HOME/odin" --strip-components=1
echo "$HOME/odin" >> "$GITHUB_PATH"
- name: Install just
run: |
mkdir -p "$HOME/.local/bin"
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Setup Toolchain
uses: ./.gitea/actions/setup
- name: Check
run: |
+37 -31
View File
@@ -1,47 +1,33 @@
#
# .gitea/workflows/gitea-release.yaml
#
# Builds a release package on version branches (e.g. 1.0) and uploads it to
# the Gitea generic package registry.
# On a version tag (e.g. v1.0): tests, builds Linux and Windows packages,
# uploads them to the Gitea generic package registry and creates a Gitea release.
#
name: "Publish"
name: "Release"
on:
push:
branches:
- '*.*'
tags:
- 'v*'
env:
ODIN_VERSION: dev-2026-09
PROJECT_NAME: HanjaKanaMun
GAME_VERSION: ${{gitea.ref_name}}
jobs:
build:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install System Dependencies
run: |
SUDO=""; command -v sudo >/dev/null && SUDO=sudo
$SUDO apt-get update
# clang links Odin programs; raylib needs X11 on Linux
$SUDO apt-get install -y --no-install-recommends clang libx11-dev curl ca-certificates
- name: Setup Toolchain
uses: ./.gitea/actions/setup
with:
packages: lld zip
- name: Install Odin
run: |
curl -fsSL -o odin.tar.gz https://github.com/odin-lang/Odin/releases/download/$ODIN_VERSION/odin-linux-amd64-$ODIN_VERSION.tar.gz
mkdir -p "$HOME/odin"
tar -xzf odin.tar.gz -C "$HOME/odin" --strip-components=1
echo "$HOME/odin" >> "$GITHUB_PATH"
- name: Install just
run: |
mkdir -p "$HOME/.local/bin"
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to "$HOME/.local/bin"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Set Version
run: echo "GAME_VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Test
run: just test
@@ -49,10 +35,30 @@ jobs:
- name: Linux Build
run: just package "$GAME_VERSION"
- name: Upload Artifact Linux
- name: Windows Build
run: |
# Debian/Ubuntu may only ship a versioned lld-link
LLD_LINK="$(command -v lld-link || ls /usr/lib/llvm-*/bin/lld-link | sort -V | tail -1)"
export LLD_LINK
just windows-deps
just package-windows "$GAME_VERSION"
- name: Upload Artifacts
run: |
ls -la build
FILE="${PROJECT_NAME}_${GAME_VERSION}_linux_x86_64.tar.gz"
curl --fail --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
--upload-file "build/$FILE" \
https://gitea.sanplex.xyz/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$FILE
for FILE in build/${PROJECT_NAME}_${GAME_VERSION}_*; do
NAME="$(basename "$FILE")"
echo "Uploading $NAME"
curl --fail --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
--upload-file "$FILE" \
https://gitea.sanplex.xyz/api/packages/sansan/generic/$PROJECT_NAME/$GAME_VERSION/$NAME
done
- name: Create Release
uses: akkuman/gitea-release-action@v1
env:
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
with:
files: |-
build/${{ env.PROJECT_NAME }}_*.tar.gz
build/${{ env.PROJECT_NAME }}_*.zip