233 lines
8.0 KiB
YAML
233 lines
8.0 KiB
YAML
name: Release builds
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: release-builds-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
linux-release:
|
|
name: Linux x64 artifact
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
env:
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
|
DOTNET_NOLOGO: "true"
|
|
NUGET_XMLDOC_MODE: skip
|
|
PYTHONUTF8: "1"
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python 3.11
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.11"
|
|
architecture: x64
|
|
|
|
- name: Set up .NET SDK
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
global-json-file: global.json
|
|
|
|
- name: Restore immutable Linux inputs
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
build/downloads/Godot_*_mono_linux_x86_64.zip
|
|
build/downloads/ffmpeg-*-linux64-lgpl-shared-*.tar.xz
|
|
build/toolchains/godot-*/xdg-data/godot/export_templates/*/linux_release.x86_64
|
|
key: linux-release-inputs-${{ hashFiles('tools/godot-linux-x64.json', 'native/age_movie_ffmpeg/dependency-linux-x64.json') }}
|
|
|
|
- name: Report toolchain
|
|
run: |
|
|
python --version
|
|
dotnet --version
|
|
cc --version
|
|
readelf --version
|
|
free -h
|
|
if [ -r /sys/fs/cgroup/memory.max ]; then
|
|
echo "cgroup memory.max=$(cat /sys/fs/cgroup/memory.max)"
|
|
echo "cgroup memory.current=$(cat /sys/fs/cgroup/memory.current)"
|
|
fi
|
|
|
|
- name: Build and smoke-test Linux package
|
|
run: ./tools/build-linux-x64.sh
|
|
|
|
- name: Stage verified workflow artifact
|
|
run: |
|
|
mkdir -p build/workflow-artifact
|
|
cp build/package/OpenMaidEngine-Himegari-linux-x64.tar.gz build/workflow-artifact/
|
|
cp build/package/staging/OpenMaidEngine-Himegari-linux-x64/BUILD-INFO.json build/workflow-artifact/
|
|
cp build/package/staging/OpenMaidEngine-Himegari-linux-x64/SHA256SUMS build/workflow-artifact/
|
|
cp build/package/package-smoke.log build/workflow-artifact/
|
|
cd build/workflow-artifact
|
|
sha256sum OpenMaidEngine-Himegari-linux-x64.tar.gz > OpenMaidEngine-Himegari-linux-x64.tar.gz.sha256
|
|
|
|
- name: Upload verified Linux package
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: OpenMaidEngine-Himegari-linux-x64-${{ gitea.sha }}
|
|
path: build/workflow-artifact/*
|
|
if-no-files-found: error
|
|
retention-days: 30
|
|
|
|
- name: Upload failure logs
|
|
if: failure()
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: linux-release-failure-${{ gitea.run_id }}-${{ gitea.run_attempt }}
|
|
path: |
|
|
build/package/package-smoke.log
|
|
build/validation/**
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|
|
|
|
windows-release:
|
|
name: Windows x64 artifact
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
env:
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
|
|
DOTNET_NOLOGO: "true"
|
|
NUGET_XMLDOC_MODE: skip
|
|
PYTHONUTF8: "1"
|
|
MINGW_CC: x86_64-w64-mingw32-gcc-posix
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python 3.11
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.11"
|
|
architecture: x64
|
|
|
|
- name: Set up .NET SDK
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
global-json-file: global.json
|
|
|
|
- name: Install MinGW cross-toolchain
|
|
run: |
|
|
sudo apt-get update
|
|
sudo DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
|
|
gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64
|
|
|
|
- name: Restore immutable Windows inputs
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
build/downloads/Godot_*_mono_linux_x86_64.zip
|
|
build/downloads/ffmpeg-*-win64-lgpl-shared-*.zip
|
|
build/toolchains/godot-*/xdg-data/godot/export_templates/*/windows_release_x86_64.exe
|
|
key: windows-release-inputs-${{ hashFiles('tools/godot-linux-x64.json', 'native/age_movie_ffmpeg/dependency-win64.json') }}
|
|
|
|
- name: Report toolchain
|
|
run: |
|
|
python --version
|
|
dotnet --version
|
|
"$MINGW_CC" --version
|
|
x86_64-w64-mingw32-objdump --version
|
|
free -h
|
|
if [ -r /sys/fs/cgroup/memory.max ]; then
|
|
echo "cgroup memory.max=$(cat /sys/fs/cgroup/memory.max)"
|
|
echo "cgroup memory.current=$(cat /sys/fs/cgroup/memory.current)"
|
|
fi
|
|
|
|
- name: Cross-build and verify Windows package
|
|
run: ./tools/build-windows-x64.sh
|
|
|
|
- name: Stage verified workflow artifact
|
|
run: |
|
|
mkdir -p build/workflow-artifact-windows
|
|
cp build/package/windows-x64/OpenMaidEngine-Himegari-windows-x64.zip build/workflow-artifact-windows/
|
|
cp build/package/windows-x64/staging/OpenMaidEngine-Himegari-windows-x64/BUILD-INFO.json build/workflow-artifact-windows/
|
|
cp build/package/windows-x64/staging/OpenMaidEngine-Himegari-windows-x64/SHA256SUMS build/workflow-artifact-windows/
|
|
cp build/package/windows-x64/staging/OpenMaidEngine-Himegari-windows-x64/WINDOWS-VERIFICATION.json build/workflow-artifact-windows/
|
|
cd build/workflow-artifact-windows
|
|
sha256sum OpenMaidEngine-Himegari-windows-x64.zip > OpenMaidEngine-Himegari-windows-x64.zip.sha256
|
|
|
|
- name: Upload verified Windows package
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: OpenMaidEngine-Himegari-windows-x64-${{ gitea.sha }}
|
|
path: build/workflow-artifact-windows/*
|
|
if-no-files-found: error
|
|
retention-days: 30
|
|
|
|
- name: Upload failure evidence
|
|
if: failure()
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: windows-release-failure-${{ gitea.run_id }}-${{ gitea.run_attempt }}
|
|
path: |
|
|
build/native/win-x64/verification.json
|
|
build/package/windows-x64/staging/OpenMaidEngine-Himegari-windows-x64/WINDOWS-VERIFICATION.json
|
|
build/validation/**
|
|
if-no-files-found: ignore
|
|
retention-days: 7
|
|
|
|
publish-release:
|
|
name: Publish tagged Gitea release
|
|
if: startsWith(gitea.ref, 'refs/tags/v')
|
|
needs:
|
|
- linux-release
|
|
- windows-release
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
permissions:
|
|
contents: read
|
|
# Gitea 1.25 granular scope; GitHub-oriented actionlint does not model it.
|
|
releases: write
|
|
steps:
|
|
- name: Check out release tooling
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python 3.11
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.11"
|
|
architecture: x64
|
|
|
|
- name: Download verified Linux artifact
|
|
uses: christopherhx/gitea-download-artifact@v4
|
|
with:
|
|
name: OpenMaidEngine-Himegari-linux-x64-${{ gitea.sha }}
|
|
path: build/release-assets/linux
|
|
|
|
- name: Download verified Windows artifact
|
|
uses: christopherhx/gitea-download-artifact@v4
|
|
with:
|
|
name: OpenMaidEngine-Himegari-windows-x64-${{ gitea.sha }}
|
|
path: build/release-assets/windows
|
|
|
|
- name: Create or resume Gitea release
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
python -X utf8 tools/publish_gitea_release.py \
|
|
--server "${{ gitea.server_url }}" \
|
|
--repository "${{ gitea.repository }}" \
|
|
--tag "${{ gitea.ref_name }}" \
|
|
--target "${{ gitea.sha }}" \
|
|
--linux-artifact-directory build/release-assets/linux \
|
|
--windows-artifact-directory build/release-assets/windows \
|
|
--output-directory build/release-assets/prepared
|