name: Build Release on: push: branches: [release] pull_request: branches: [release] jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: preset: ["Windows", "Linux/X11", "Web"] steps: - uses: actions/checkout@v6 - name: Extract version and body from CHANGELOG id: changelog 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 }} - 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" - name: Show raw build output run: echo "Raw build path: ${{ steps.build.outputs.build }}" - name: Normalize build path run: | NORMALIZED_PATH=$(realpath -s "${{ steps.build.outputs.build }}") echo "Normalized build path: $NORMALIZED_PATH" echo "BUILD_PATH=$NORMALIZED_PATH" >> $GITHUB_ENV - name: Upload builds uses: actions/upload-artifact@v5 with: name: ${{ matrix.preset }}-build path: ${{ env.BUILD_PATH }} - name: Create Release uses: akkuman/gitea-release-action@v1 with: server_url: ${{ vars.SERVER_URL }} tag_name: ${{ steps.changelog.outputs.version }} name: "${{ steps.changelog.outputs.version }}" body: ${{ steps.changelog.outputs.body }} draft: false token: ${{ secrets.GITEA_TOKEN }}