feat: implement Candy Cannon mechanics, CI/CD pipelines, and version 2.3.7 updates

This commit is contained in:
2026-05-25 18:17:00 +08:00
parent 7380161743
commit f2f90f98e2
20 changed files with 952 additions and 36 deletions
+138
View File
@@ -0,0 +1,138 @@
name: Build and Export
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to build (e.g., 2.3.8)'
required: true
type: string
jobs:
build-windows:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Godot
uses: chickensoft-games/setup-godot@v1
with:
version: '4.3.0'
use-dotnet: false
- name: Setup Export Templates
run: |
mkdir -p ~/.local/share/godot/export_templates/4.3.0.stable
wget https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_export_templates.tpz
unzip Godot_v4.3-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.3.0.stable
- name: Export Windows Build
run: |
mkdir -p build
godot --headless --export-release "Windows Desktop" build/tekton_armageddon_windows.exe
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: windows-build
path: build/tekton_armageddon_windows.exe
retention-days: 30
build-android:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Godot
uses: chickensoft-games/setup-godot@v1
with:
version: '4.3.0'
use-dotnet: false
- name: Setup Export Templates
run: |
mkdir -p ~/.local/share/godot/export_templates/4.3.0.stable
wget https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_export_templates.tpz
unzip Godot_v4.3-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.3.0.stable
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Export Android Build
run: |
mkdir -p build
godot --headless --export-release "Android" build/tekton_armageddon_android.apk
- name: Upload Android Artifact
uses: actions/upload-artifact@v4
with:
name: android-build
path: build/tekton_armageddon_android.apk
retention-days: 30
build-macos:
runs-on: macos-latest
permissions:
contents: write
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Godot
uses: chickensoft-games/setup-godot@v1
with:
version: '4.3.0'
use-dotnet: false
- name: Setup Export Templates
run: |
mkdir -p ~/Library/Application\ Support/Godot/export_templates/4.3.0.stable
wget https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_export_templates.tpz
unzip Godot_v4.3-stable_export_templates.tpz -d ~/Library/Application\ Support/Godot/export_templates/4.3.0.stable
- name: Export macOS Build
run: |
mkdir -p build
godot --headless --export-release "macOS" build/tekton_armageddon_macos.zip
- name: Upload macOS Artifact
uses: actions/upload-artifact@v4
with:
name: macos-build
path: build/tekton_armageddon_macos.zip
retention-days: 30
create-release:
needs: [build-windows, build-android, build-macos]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
windows-build/tekton_armageddon_windows.exe
android-build/tekton_armageddon_android.apk
macos-build/tekton_armageddon_macos.zip
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+163
View File
@@ -0,0 +1,163 @@
name: Build Platform Artifacts
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
version:
description: 'Version to build (e.g., 2.3.8)'
required: true
type: string
jobs:
build-artifacts:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
platform:
- name: Windows
preset: "Windows Desktop"
extension: exe
- name: Linux
preset: "Linux/X11"
extension: x86_64
- name: Android
preset: "Android"
extension: apk
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Godot
uses: chickensoft-games/setup-godot@v1
with:
version: '4.3.0'
use-dotnet: false
- name: Setup Android SDK (Android only)
if: matrix.platform.name == 'Android'
uses: android-actions/setup-android@v3
- name: Extract Version
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="${GITHUB_REF#refs/tags/v}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Building version: $VERSION"
- name: Create Build Directory
run: mkdir -p build
- name: Export Game
run: |
godot --headless --export-release "${{ matrix.platform.preset }}" \
"build/tekton_armageddon_${{ matrix.platform.name }}_v${{ steps.version.outputs.version }}.${{ matrix.platform.extension }}"
- name: Generate Checksums
run: |
cd build
sha256sum tekton_armageddon_${{ matrix.platform.name }}_v${{ steps.version.outputs.version }}.${{ matrix.platform.extension }} \
> tekton_armageddon_${{ matrix.platform.name }}_v${{ steps.version.outputs.version }}.sha256
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: tekton-${{ matrix.platform.name }}-v${{ steps.version.outputs.version }}
path: |
build/tekton_armageddon_${{ matrix.platform.name }}_v${{ steps.version.outputs.version }}.${{ matrix.platform.extension }}
build/tekton_armageddon_${{ matrix.platform.name }}_v${{ steps.version.outputs.version }}.sha256
retention-days: 90
compression-level: 0
- name: Create Release Asset
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
build/tekton_armageddon_${{ matrix.platform.name }}_v${{ steps.version.outputs.version }}.${{ matrix.platform.extension }}
build/tekton_armageddon_${{ matrix.platform.name }}_v${{ steps.version.outputs.version }}.sha256
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-patch:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Godot
uses: chickensoft-games/setup-godot@v1
with:
version: '4.3.0'
use-dotnet: false
- name: Extract Version
id: version
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="${GITHUB_REF#refs/tags/v}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build Patch PCK
run: godot --headless -s tools/build_patch.gd
- name: Generate Patch Checksum
run: |
sha256sum patch.pck > patch.pck.sha256
- name: Upload Patch Artifact
uses: actions/upload-artifact@v4
with:
name: tekton-patch-v${{ steps.version.outputs.version }}
path: |
patch.pck
patch.pck.sha256
retention-days: 90
- name: Push to Updates Repository
if: startsWith(github.ref, 'refs/tags/')
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUBLIC_REPO_PAT }}
with:
source_file: 'patch.pck'
destination_repo: '${{ github.actor }}/tekton-updates'
destination_folder: 'v${{ steps.version.outputs.version }}'
user_email: 'action@github.com'
user_name: 'PatchBot'
commit_message: '[AUTO] Release v${{ steps.version.outputs.version }} patch'
- name: Push Checksum to Updates Repository
if: startsWith(github.ref, 'refs/tags/')
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUBLIC_REPO_PAT }}
with:
source_file: 'patch.pck.sha256'
destination_repo: '${{ github.actor }}/tekton-updates'
destination_folder: 'v${{ steps.version.outputs.version }}'
user_email: 'action@github.com'
user_name: 'PatchBot'
commit_message: '[AUTO] Release v${{ steps.version.outputs.version }} checksum'
+51 -2
View File
@@ -54,7 +54,32 @@ jobs:
- name: Run Build Patch Script
run: godot --headless -s tools/build_patch.gd
# ── 5. Push patch.pck to public repo ─────────────────────────────────
# ── 5. Generate checksums ─────────────────────────────────────────────────
- name: Generate Checksums
run: |
sha256sum patch.pck > patch.pck.sha256
sha256sum assets/data/version.json > version.json.sha256
# ── 6. Upload artifacts to GitHub ─────────────────────────────────────────
- name: Upload Patch Artifacts
uses: actions/upload-artifact@v4
with:
name: patch-pck-${{ github.sha }}
path: |
patch.pck
patch.pck.sha256
retention-days: 90
- name: Upload Version Manifest
uses: actions/upload-artifact@v4
with:
name: version-manifest-${{ github.sha }}
path: |
assets/data/version.json
version.json.sha256
retention-days: 90
# ── 7. Push patch.pck to public repo ─────────────────────────────────────
- name: Push patch.pck to Public Repository
uses: dmnemec/copy_file_to_another_repo_action@main
env:
@@ -67,7 +92,19 @@ jobs:
user_name: 'PatchBot'
commit_message: '[AUTO] Pushed new patch.pck'
# ── 6. Push version.json to public repo ──────────────────────────────
- name: Push patch checksum to Public Repository
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUBLIC_REPO_PAT }}
with:
source_file: 'patch.pck.sha256'
destination_repo: '${{ github.actor }}/tekton-updates'
destination_folder: 'latest'
user_email: 'action@github.com'
user_name: 'PatchBot'
commit_message: '[AUTO] Pushed patch checksum'
# ── 8. Push version.json to public repo ──────────────────────────────────
- name: Push version.json to Public Repository
uses: dmnemec/copy_file_to_another_repo_action@main
env:
@@ -79,3 +116,15 @@ jobs:
user_email: 'action@github.com'
user_name: 'PatchBot'
commit_message: '[AUTO] Pushed new version.json'
- name: Push version checksum to Public Repository
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUBLIC_REPO_PAT }}
with:
source_file: 'version.json.sha256'
destination_repo: '${{ github.actor }}/tekton-updates'
destination_folder: 'latest'
user_email: 'action@github.com'
user_name: 'PatchBot'
commit_message: '[AUTO] Pushed version checksum'
+59
View File
@@ -0,0 +1,59 @@
name: Automated Testing
on:
push:
branches:
- main
- develop
- 'feature/**'
- 'patch-release'
pull_request:
branches:
- main
- develop
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Godot
uses: chickensoft-games/setup-godot@v1
with:
version: '4.3.0'
use-dotnet: false
- name: Verify GUT Installation
run: |
if [ ! -d "addons/gut" ]; then
echo "ERROR: GUT addon not found at addons/gut"
exit 1
fi
echo "GUT addon found"
- name: Run Unit Tests
run: |
godot --headless --path . -s res://addons/gut/gut_cmdln.gd \
-gdir=res://tests/ \
-gexit \
-glog=2
- name: Check Test Results
if: failure()
run: |
echo "Tests failed. Check logs above for details."
exit 1
- name: Upload Test Reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: test_reports/
retention-days: 30