Fixed collision bug with action
This commit is contained in:
@@ -1,20 +1,28 @@
|
||||
name: Nightly Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
# The default token is read-only; release/tag operations need write.
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
# ---- Build each platform in parallel, upload outputs as artifacts ----
|
||||
build-nightly:
|
||||
name: Build Nightly Release
|
||||
name: Build Nightly (${{ matrix.platform }})
|
||||
runs-on: Debian-x86
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [linux, windows, mac]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: Build
|
||||
id: build
|
||||
uses: felix-schindler/build-godot-action@v2.0.0
|
||||
@@ -22,20 +30,45 @@ jobs:
|
||||
name: wrplat
|
||||
preset: ${{ matrix.platform }}
|
||||
debugMode: "true"
|
||||
- name: Clean up Release & Update Tag
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
# Unique name per platform so the matrix jobs don't collide
|
||||
name: build-${{ matrix.platform }}
|
||||
path: ${{ github.workspace }}/${{ steps.build.outputs.build }}
|
||||
if-no-files-found: error
|
||||
|
||||
# ---- Runs once, only after all three builds succeed ----
|
||||
release-nightly:
|
||||
name: Publish Nightly Release
|
||||
needs: build-nightly
|
||||
runs-on: Debian-x86
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download all build artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
# No 'name' → grabs every artifact, each into dist/<artifact-name>/
|
||||
path: dist
|
||||
|
||||
- name: Clean up old release & move tag
|
||||
run: |
|
||||
# Find and delete the old Gitea Release payload via API
|
||||
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/nightly | jq -r '.id')
|
||||
# Find and delete the old Gitea release payload via API
|
||||
RELEASE_ID=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
"${{ github.api_url }}/repos/${{ github.repository }}/releases/tags/nightly" | jq -r '.id')
|
||||
if [ "$RELEASE_ID" != "null" ] && [ -n "$RELEASE_ID" ]; then
|
||||
echo "Deleting old release ID: $RELEASE_ID"
|
||||
curl -s -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ github.api_url }}/repos/${{ github.repository }}/releases/$RELEASE_ID
|
||||
curl -s -X DELETE -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
"${{ github.api_url }}/repos/${{ github.repository }}/releases/$RELEASE_ID"
|
||||
fi
|
||||
|
||||
# Force the 'nightly' Git tag to point to this new commit and push it
|
||||
|
||||
# Force the 'nightly' tag onto this commit and push it
|
||||
git tag -f nightly ${{ github.sha }}
|
||||
git push -f origin nightly
|
||||
|
||||
- name: Update Nightly Release
|
||||
- name: Publish release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: nightly
|
||||
@@ -43,10 +76,9 @@ jobs:
|
||||
name: "Nightly Development Build"
|
||||
body: |
|
||||
Automated rolling nightly build from the latest commit on `main`.
|
||||
|
||||
|
||||
**Commit:** ${{ github.sha }}
|
||||
prerelease: true
|
||||
files: |
|
||||
${{ github.workspace }}/${{ steps.build.outputs.build }}
|
||||
files: dist/**/*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user