178 lines
5.8 KiB
YAML
178 lines
5.8 KiB
YAML
name: Build Platform Artifacts
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version to build (e.g., 2.4.0)'
|
|
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.6.0'
|
|
use-dotnet: false
|
|
|
|
- name: Setup Export Templates
|
|
run: |
|
|
TEMPLATES_DIR=~/.local/share/godot/export_templates/4.6.stable
|
|
mkdir -p "$TEMPLATES_DIR"
|
|
wget -q https://github.com/godotengine/godot/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz -O templates.tpz
|
|
unzip -q templates.tpz -d "$TEMPLATES_DIR"
|
|
mv "$TEMPLATES_DIR/templates/"* "$TEMPLATES_DIR/"
|
|
rmdir "$TEMPLATES_DIR/templates"
|
|
|
|
- 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.6.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: Generate Changed Files List
|
|
run: |
|
|
find scripts/ scenes/ assets/ -type f > changed_files.txt
|
|
echo "Patching $(wc -l < changed_files.txt) files"
|
|
|
|
- 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'
|