Files
LegacyRenouveau/.github/workflows/stable.yml
T
2026-06-15 20:12:02 -04:00

190 lines
5.9 KiB
YAML

name: Stable Release
on:
push:
paths:
- 'BUMP' #neo: this is a file. edit it. contains version number
#neo: DO NOT ADD NOTES.md HERE.
workflow_dispatch:
permissions:
actions: read
contents: write
id-token: write
attestations: write
concurrency:
group: stable
cancel-in-progress: true
jobs:
build:
if: >
!gitea.event.head_commit ||
!contains(gitea.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ gitea.event_name == 'workflow_dispatch' && inputs.branch || gitea.ref_name }}
submodules: recursive
- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 21
sudo apt-get update -qq
sudo apt-get install -y wine
sudo apt-get install -y --no-install-recommends \
cmake ninja-build rsync zip util-linux \
clang-21 lld-21 llvm-21 clang-tools-21 jq
- name: Install xwin (Binary)
run: |
curl -L https://github.com/Jake-Shadle/xwin/releases/download/0.8.0/xwin-0.8.0-x86_64-unknown-linux-musl.tar.gz | tar xz
sudo mv xwin-*/xwin /usr/bin/
xwin --version
- name: Create Tool Symlinks
run: |
sudo ln -sf /usr/bin/clang-cl-21 /usr/bin/clang-cl
sudo ln -sf /usr/bin/llvm-ml-21 /usr/bin/llvm-ml
sudo ln -sf /usr/bin/lld-link-21 /usr/bin/lld-link
sudo ln -sf /usr/bin/clang-21 /usr/bin/clang
sudo ln -sf /usr/bin/llvm-rc-21 /usr/bin/llvm-rc
sudo ln -sf /usr/bin/llvm-lib-21 /usr/bin/llvm-lib
sudo ln -sf /usr/bin/llvm-mt-21 /usr/bin/llvm-mt
clang-cl --version
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Build
run: |
export INSTALL_PREFIX=$PWD/result
taskset -c 1-3 ./build-linux.sh . Release
- name: Package artifacts
run: |
mkdir -p staging
cd result/client
zip -r ../../staging/neoLegacyWindows64.zip .
cd ../..
cd result/server
zip -r ../../staging/neoLegacyServerWindows64.zip .
cd ../..
cd result/fourkit
zip -r ../../staging/neoLegacyServerWindows64-FourKit.zip .
cd ../..
- name: Upload build artifacts
uses: christopherhx/gitea-upload-artifact@v4
with:
name: build-windows64
path: staging/*
release:
needs: build
if: >
!gitea.event.head_commit ||
!contains(gitea.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-24.04
steps:
# putting this here instead
# cause apparently checkouts
# can replace artifact data??
- name: Minimal checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
sparse-checkout: |
BUMP
NOTES.md
- name: Download build artifacts
uses: christopherhx/gitea-download-artifact@v4
with:
name: build-windows64
path: artifacts
- name: Fetch information
id: vars
run: |
VERSION="$(tr -d '\r\n' < BUMP)"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
{
echo "description<<EOF"
cat NOTES.md
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Publish stable server release
uses: akkuman/gitea-release-action@v1
with:
name: ${{ steps.vars.outputs.version }} Server
direction: upload
server_url: ${{ gitea.server_url }}
repository: ${{ gitea.repository }}
token: ${{ gitea.token }}
tag_name: ${{ steps.vars.outputs.version }}-Dedicated-Server
prerelease: false
# override: true
verbose: true
files: artifacts/neoLegacyServerWindows64*.zip
body: |
Dedicated Server runtime for Windows64.
Two flavours are attached:
- \`neoLegacyServerWindows64.zip\`: vanilla server, no plugin support, smallest download.
- \`neoLegacyServerWindows64-FourKit.zip\`: server with the FourKit plugin host, bundled .NET 10 runtime, and an empty \`plugins/\` folder ready for plugin authors to drop DLLs into.
Pick the flavour you want and extract it to a folder where you'd like to keep the server runtime.
- name: Publish stable client release
uses: akkuman/gitea-release-action@v1
with:
name: ${{ steps.vars.outputs.version }}
direction: upload
server_url: ${{ gitea.server_url }}
repository: ${{ gitea.repository }}
token: ${{ gitea.token }}
tag_name: ${{ steps.vars.outputs.version }}
prerelease: false
# override: true
verbose: true
files: artifacts/neoLegacyWindows64.zip
body: ${{ steps.vars.outputs.description }}
cleanup:
needs: [build, release]
if: always()
runs-on: ubuntu-24.04
steps:
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Delete build artifacts
env:
FORGE_TOKEN: ${{ gitea.token }}
REPO: ${{ gitea.repository }}
API: ${{ gitea.server_url }}/api/v1
run: |
AUTH="Authorization: token $FORGE_TOKEN"
ARTIFACTS=$(curl -s -H "$AUTH" \
"$API/repos/$REPO/actions/artifacts?name=build-windows64")
for ARTIFACT_ID in $(echo "$ARTIFACTS" | jq -r '.artifacts[].id // empty'); do
curl -s -X DELETE -H "$AUTH" \
"$API/repos/$REPO/actions/artifacts/$ARTIFACT_ID"
done