- justfile with build/run/check/test/release/package/fmt/clean recipes - ols.json and odinfmt.json for neovim (ols) - Tests for memory game rules and card animation; memory.deal and memory.select_card split out so logic is testable without a window - Gitea workflows: build+test on main/develop, package and upload to the generic package registry on version branches - Game changes to the executable's directory so packaged builds find assets Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
1.8 KiB
YAML
59 lines
1.8 KiB
YAML
#
|
|
# .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.
|
|
#
|
|
|
|
name: "Publish"
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*.*'
|
|
|
|
env:
|
|
ODIN_VERSION: dev-2026-09
|
|
PROJECT_NAME: HanjaKanaMun
|
|
GAME_VERSION: ${{gitea.ref_name}}
|
|
|
|
jobs:
|
|
build:
|
|
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: 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: Test
|
|
run: just test
|
|
|
|
- name: Linux Build
|
|
run: just package "$GAME_VERSION"
|
|
|
|
- name: Upload Artifact Linux
|
|
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
|