Split build to chunks
This commit is contained in:
parent
c59de06d6b
commit
510adab5b2
@ -31,13 +31,13 @@ jobs:
|
||||
|
||||
- name: Build for Windows
|
||||
run: |
|
||||
chmod +x ./win_build.sh
|
||||
./win_build.sh
|
||||
# Chmod command doesn't exist in Windows, use PowerShell to run the bash script
|
||||
& 'C:\Program Files\Git\bin\bash.exe' -c "./win_build.sh"
|
||||
|
||||
- name: Build for Linux
|
||||
run: |
|
||||
chmod +x ./linux_build.sh
|
||||
./linux_build.sh
|
||||
# Chmod command doesn't exist in Windows, use PowerShell to run the bash script
|
||||
& 'C:\Program Files\Git\bin\bash.exe' -c "./linux_build.sh"
|
||||
|
||||
- name: Package builds
|
||||
run: |
|
||||
@ -58,6 +58,22 @@ jobs:
|
||||
echo "=== Packaged releases ==="
|
||||
ls -la PackagedReleases/
|
||||
|
||||
- name: Upload Windows Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
if: success() && hashFiles('PackagedReleases/LuckyRobots-Windows.zip') != ''
|
||||
with:
|
||||
name: LuckyRobots-Windows
|
||||
path: PackagedReleases/LuckyRobots-Windows.zip
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload Linux Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
if: success() && hashFiles('PackagedReleases/LuckyRobots-Linux.zip') != ''
|
||||
with:
|
||||
name: LuckyRobots-Linux
|
||||
path: PackagedReleases/LuckyRobots-Linux.zip
|
||||
retention-days: 14
|
||||
|
||||
- name: Create Tag
|
||||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
|
||||
run: |
|
||||
@ -117,21 +133,96 @@ jobs:
|
||||
fi
|
||||
echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV
|
||||
|
||||
- name: Create Build Info
|
||||
run: |
|
||||
# Create a build info JSON file
|
||||
echo '{
|
||||
"version": "${{ env.RELEASE_TAG }}",
|
||||
"buildNumber": "${{ github.run_number }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}",
|
||||
"buildDate": "'$(date -u +"%Y-%m-%dT%H:%M:%SZ")'",
|
||||
"artifacts": {
|
||||
"windows": "https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-Windows",
|
||||
"linux": "https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-Linux"
|
||||
}
|
||||
}' > PackagedReleases/build-info.json
|
||||
|
||||
# Create a simple HTML download page
|
||||
echo '<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LuckyRobots ${{ env.RELEASE_TAG }} Downloads</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; }
|
||||
h1 { color: #333; }
|
||||
.download-btn {
|
||||
display: inline-block;
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
text-decoration: none;
|
||||
border-radius: 4px;
|
||||
margin: 10px 5px;
|
||||
}
|
||||
.download-btn:hover { background-color: #45a049; }
|
||||
.platform { margin-bottom: 30px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>LuckyRobots Game - ${{ env.RELEASE_TAG }}</h1>
|
||||
<p>Build #${{ github.run_number }} - Built from commit: ${{ github.sha }}</p>
|
||||
|
||||
<div class="platform">
|
||||
<h2>Windows</h2>
|
||||
<p><a href="https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-Windows" class="download-btn">Download Windows Build</a></p>
|
||||
</div>
|
||||
|
||||
<div class="platform">
|
||||
<h2>Linux</h2>
|
||||
<p><a href="https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-Linux" class="download-btn">Download Linux Build</a></p>
|
||||
</div>
|
||||
|
||||
<div class="platform">
|
||||
<h2>macOS</h2>
|
||||
<p><a href="https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-macOS" class="download-btn">Download macOS Build</a></p>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>Generated on '$(date -u +"%Y-%m-%d %H:%M:%S UTC")'</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>' > PackagedReleases/downloads.html
|
||||
|
||||
- name: Create Release
|
||||
uses: https://gitea.com/actions/gitea-release-action@main
|
||||
with:
|
||||
files: |-
|
||||
PackagedReleases/*.zip
|
||||
PackagedReleases/build-info.json
|
||||
PackagedReleases/downloads.html
|
||||
token: '${{ secrets.GITEA_TOKEN }}'
|
||||
title: 'Release ${{ env.RELEASE_TAG }}'
|
||||
body: |
|
||||
## Automated release from CI build #${{ github.run_number }}
|
||||
## LuckyRobots Game Release ${{ env.RELEASE_TAG }}
|
||||
|
||||
This release includes builds for:
|
||||
- Windows
|
||||
- Linux
|
||||
### Download Links
|
||||
|
||||
Built from commit: ${{ github.sha }}
|
||||
Download builds from our CI artifacts:
|
||||
|
||||
- [Windows Build](https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-Windows)
|
||||
- [Linux Build](https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-Linux)
|
||||
- [macOS Build](https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-macOS)
|
||||
|
||||
Or visit our [download page](https://luckyrobots.com/luckyrobots/luckyworld/releases/download/${{ env.RELEASE_TAG }}/downloads.html).
|
||||
|
||||
### Build Information
|
||||
|
||||
- Build Number: #${{ github.run_number }}
|
||||
- Commit: ${{ github.sha }}
|
||||
- Branch: ${{ github.ref_name }}
|
||||
- Build Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")
|
||||
prerelease: ${{ github.ref != 'refs/heads/main' }}
|
||||
tag_name: '${{ env.RELEASE_TAG }}'
|
||||
|
||||
@ -232,18 +323,35 @@ jobs:
|
||||
echo "Packaged releases:"
|
||||
ls -la PackagedReleases/
|
||||
|
||||
- name: Upload macOS Build Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
if: success()
|
||||
with:
|
||||
name: LuckyRobots-macOS
|
||||
path: PackagedReleases/*-macOS.zip
|
||||
retention-days: 14
|
||||
|
||||
- name: Create Release Note
|
||||
run: |
|
||||
echo "## macOS Build Completed" > release-note.md
|
||||
echo "" >> release-note.md
|
||||
echo "macOS build is available as an artifact." >> release-note.md
|
||||
echo "" >> release-note.md
|
||||
echo "Download from: [macOS Build](https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-macOS)" >> release-note.md
|
||||
|
||||
- name: Create Gitea Release
|
||||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
|
||||
uses: https://gitea.com/actions/gitea-release-action@main
|
||||
with:
|
||||
token: ${{ secrets.GITEATOKEN }}
|
||||
tag_name: ${{ env.RELEASE_TAG }}
|
||||
title: "Release ${{ env.RELEASE_TAG }}"
|
||||
title: "Release ${{ env.RELEASE_TAG }} - macOS"
|
||||
body: |
|
||||
## Automated release from CI build #${{ github.run_number }}
|
||||
## macOS Build Available as Artifact
|
||||
|
||||
This release includes builds for:
|
||||
- macOS
|
||||
The macOS build is available as an artifact due to its large file size.
|
||||
|
||||
[Download macOS Build](https://luckyrobots.com/luckyrobots/luckyworld/actions/runs/${{ github.run_id }}/artifacts/LuckyRobots-macOS)
|
||||
|
||||
Built from commit: ${{ github.sha }}
|
||||
files: PackagedReleases/*.zip
|
||||
files: release-note.md
|
Loading…
x
Reference in New Issue
Block a user