From c3390cf83808bbf023d14d2b0963bb557813c1d8 Mon Sep 17 00:00:00 2001 From: Goran Lazarevski Date: Fri, 28 Mar 2025 12:23:40 +0100 Subject: [PATCH] Add action for releases --- .gitea/workflows/create-release.yml | 53 +++++++++++++++++++++++++++++ .gitea/workflows/unreal-build.yml | 12 +++++++ 2 files changed, 65 insertions(+) create mode 100644 .gitea/workflows/create-release.yml diff --git a/.gitea/workflows/create-release.yml b/.gitea/workflows/create-release.yml new file mode 100644 index 00000000..a3589ca6 --- /dev/null +++ b/.gitea/workflows/create-release.yml @@ -0,0 +1,53 @@ +name: Create Release + +on: + workflow_dispatch: + inputs: + build_id: + description: 'Build Run ID to use artifacts from' + required: true + default: '' + version: + description: 'Version for this release (e.g. 1.0.0)' + required: true + default: '' + prerelease: + description: 'Is this a pre-release?' + required: true + default: 'false' + type: boolean + +jobs: + create-release: + runs-on: [self-hosted] + steps: + - name: Manual Clone + run: | + echo "Current directory: $(pwd)" + echo "Repository URL: http://gitea:3000/luckyrobots/luckyworld.git" + + # Clean workspace + rm -rf * .[!.]* ..?* 2>/dev/null || true + + # Clone directly using the hostname that works (confirmed by ping) + git clone --depth=1 http://gitea:3000/luckyrobots/luckyworld.git . + + # Verify clone succeeded + git status + + - name: List Artifacts Directory + run: | + echo "Creating Builds directory" + mkdir -p Builds + ls -la + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + artifacts: "Builds/*" + token: ${{ secrets.GITHUB_TOKEN }} + generateReleaseNotes: true + tag: v${{ github.event.inputs.version }} + name: Release v${{ github.event.inputs.version }} + prerelease: ${{ github.event.inputs.prerelease }} + draft: false \ No newline at end of file diff --git a/.gitea/workflows/unreal-build.yml b/.gitea/workflows/unreal-build.yml index 9ab0c52f..35ccae5a 100644 --- a/.gitea/workflows/unreal-build.yml +++ b/.gitea/workflows/unreal-build.yml @@ -81,3 +81,15 @@ jobs: name: macos-build path: Builds/ retention-days: 7 + + - name: Create Release + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' + uses: ncipollo/release-action@v1 + with: + artifacts: "Builds/*" + token: ${{ secrets.GITHUB_TOKEN }} + generateReleaseNotes: true + tag: v${{ github.run_number }} + name: Release v${{ github.run_number }} + prerelease: ${{ github.ref != 'refs/heads/main' }} + draft: false