Better publish script
Some checks failed
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-debug, Debug Template, no, template_debug) (push) Successful in 21m43s
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-editor, Editor, yes, editor) (push) Successful in 33m49s
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-release, Release Template, yes, template_release) (push) Successful in 22m51s
Build Godot Engine / publish (push) Failing after 18s

This commit is contained in:
2025-12-02 23:54:44 +01:00
parent b21a22f4b9
commit bf4cb1830e
2 changed files with 55 additions and 38 deletions

View File

@ -58,53 +58,23 @@ jobs:
# --- JOB 2: PUBLISH (Serial) ---
publish:
# Only run if all builds succeed
needs: build-windows
runs-on: ubuntu-latest
steps:
# 1. Download ALL artifacts from the matrix jobs
- name: Download All Artifacts
uses: actions/download-artifact@v3
with:
path: dist
- name: Organize and Publish
- name: Package and Publish
uses: docker://alpine:latest
env:
# Pass config & secrets
API_URL: https://gitea.212.63.210.91.nip.io/api/packages/${{ gitea.repository_owner }}/generic
TOKEN: ${{ secrets.USER_PACKAGE_PASSWORD }}
ACTOR: ${{ gitea.actor }}
VERSION: ${{ gitea.sha }}
run: |
echo "Organizing artifacts..."
ls -R dist/
# Structure after download will look like:
# dist/godot-windows-editor/godot.windows.editor...exe
# dist/godot-windows-debug/godot.windows.template_debug...exe
# --- 1. PUBLISH EDITOR ---
echo "Publishing Editor..."
# Find the editor exe (using wildcard to be safe)
EDITOR_EXE=$(find dist/godot-windows-editor -name "*.exe")
curl --fail --user "${{ gitea.actor }}:$TOKEN" \
--upload-file "$EDITOR_EXE" \
"$API_URL/godot-editor-windows/$VERSION/godot-editor.exe"
# --- 2. PACKAGE TEMPLATES ---
echo "Zipping Templates..."
mkdir -p templates
# Copy debug and release templates to a single folder
# We rename them to simple names for the zip
cp dist/godot-windows-debug/*.exe templates/windows_debug_x86_64.exe
cp dist/godot-windows-release/*.exe templates/windows_release_x86_64.exe
# Zip them up
zip -j templates.tpz templates/*
echo "Publishing Templates..."
curl --fail --user "${{ gitea.actor }}:$TOKEN" \
--upload-file "templates.tpz" \
"$API_URL/godot-templates/$VERSION/windows_templates.tpz"
echo "✅ All packages published!"
with:
entrypoint: /bin/sh
# The workspace (containing 'dist' and 'scripts') is automatically mounted
args: .gitea/workflows/scripts/publish.sh

View File

@ -0,0 +1,47 @@
#!/bin/sh
set -e
# --- 0. SETUP ---
# We install dependencies because we are running in a minimal Alpine container
echo "Installing tools..."
apk add --no-cache curl zip
echo "------------------------------------------------"
echo "Publishing Packages for: $VERSION"
echo "Registry API: $API_URL"
echo "------------------------------------------------"
# --- 1. PUBLISH EDITOR ---
echo "Processing Editor..."
# Zip both .exe and .console.exe
zip -j godot-editor-windows.zip dist/godot-windows-editor/*.exe
echo "Uploading Editor..."
curl --fail --user "$ACTOR:$TOKEN" \
--upload-file "godot-editor-windows.zip" \
"$API_URL/godot-editor-windows/$VERSION/godot-editor-windows.zip"
# --- 2. PUBLISH TEMPLATES ---
echo "Processing Templates..."
mkdir -p templates
# Select specific binaries (ignoring console wrapper)
DEBUG_SRC=$(find dist/godot-windows-debug -name "*.exe" | grep -v "console.exe" | head -n 1)
RELEASE_SRC=$(find dist/godot-windows-release -name "*.exe" | grep -v "console.exe" | head -n 1)
echo "Found Debug: $DEBUG_SRC"
echo "Found Release: $RELEASE_SRC"
# Rename to standard Godot export names
cp "$DEBUG_SRC" templates/windows_debug_x86_64.exe
cp "$RELEASE_SRC" templates/windows_release_x86_64.exe
# Zip into TPZ
zip -j templates.tpz templates/*
echo "Uploading Templates..."
curl --fail --user "$ACTOR:$TOKEN" \
--upload-file "templates.tpz" \
"$API_URL/godot-templates/$VERSION/windows_templates.tpz"
echo "✅ Success! All packages published."