From ef8e3d7d15f0a34f42a95177866e57b93deb85ed Mon Sep 17 00:00:00 2001 From: ArthurErlich Date: Tue, 17 Mar 2026 20:47:01 +0100 Subject: [PATCH] fix: refactor release workflow to streamline export process and update platform configuration --- .gitea/workflows/release.yml | 88 +++++++++++++++++------------------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 8a25963..c666984 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -7,65 +7,59 @@ on: branches: [release] jobs: - build: - runs-on: ubuntu-latest + export: + name: Export (${{ matrix.platform }}) + runs-on: ubuntu-24.04 + container: + image: barichello/godot-ci:4.3 + strategy: - fail-fast: false matrix: - preset: ["Windows", "Linux/X11", "Web"] + include: + - platform: windows + export_name: "Windows" + output: "windows/Experements.exe" + + # - platform: linux + # export_name: "Linux/X11" + # output: "linux/Experements.x86_64" + + # - platform: web + # export_name: "Web" + # output: "web/index.html" + + # - platform: mac + # export_name: "macOS" + # output: "mac/Experements.zip" steps: - - uses: actions/checkout@v6 + - name: Checkout + uses: actions/checkout@v6 + with: + lfs: true - - name: Extract version and body from CHANGELOG - id: changelog + - name: Setup run: | - # Extract the latest released version (skip Unreleased) - LATEST=$(grep -E '^## \[[0-9]+\.[0-9]+\.[0-9]+\]' CHANGELOG.md | head -n1 | sed -E 's/^## \[([0-9]+\.[0-9]+\.[0-9]+)\].*/\1/') - - if [ -z "$LATEST" ]; then - echo "No released version found in CHANGELOG.md" - exit 1 - fi - - echo "Released version found: $LATEST" - echo "version=$LATEST" >> $GITHUB_OUTPUT - - # Extract the body: lines until the next ## header - BODY=$(awk -v ver="$LATEST" ' - $0 ~ "^## \\[" ver "\\]" {found=1; next} - found && $0 ~ "^## \\[" {exit} - found {print} - ' CHANGELOG.md) - - # Trim leading/trailing empty lines - BODY=$(echo "$BODY" | sed '/^\s*$/d') - - # Output body safely for GitHub Actions - echo "body<> $GITHUB_OUTPUT - echo "$BODY" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - # Create Release also creates an Tag - # - name: Create git tag - # uses: alazhar/gitea-action-autotag@v1 - # with: - # tag: ${{ steps.changelog.outputs.version }} + mkdir -v -p ~/.local/share/godot/export_templates/ + mkdir -v -p ~/.config/ + mv /root/.config/godot ~/.config/godot + mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable - name: Build - id: build - uses: mlm-games/godot-build-action@v1.3.1 - with: - EXPORT_PRESET_NAME: ${{ matrix.preset }} - INSTALL_BLENDER: "true" - BLENDER_VERSION: "5.0.0" - VERBOSE_IMPORT: "false" + run: | + mkdir -v -p build/${{ matrix.platform }} + EXPORT_DIR="$(readlink -f build)" + cd $PROJECT_PATH + + godot --headless --verbose --export-release \ + "${{ matrix.export_name }}" \ + "$EXPORT_DIR/${{ matrix.output }}" - name: Upload builds uses: actions/upload-artifact@v5 with: - name: ${{ matrix.preset }}-build - path: ${{ steps.build.outputs.build }} + name: ${{ matrix.platform }} + path: build/${{ matrix.platform }} - name: Create Release uses: akkuman/gitea-release-action@v1