129 lines
3.9 KiB
YAML
129 lines
3.9 KiB
YAML
name: Build and Export
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version to build (e.g., 2.4.0)'
|
|
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.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: Export Windows Build
|
|
run: |
|
|
mkdir -p build
|
|
godot --headless --export-release "Windows Desktop" build/tekton_armageddon_windows.exe
|
|
|
|
- name: Zip Windows Build
|
|
run: cd build && zip tekton_armageddon_windows.zip tekton_armageddon_windows.exe
|
|
|
|
- name: Upload Windows Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-build
|
|
path: build/tekton_armageddon_windows.zip
|
|
retention-days: 30
|
|
|
|
build-linux:
|
|
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.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: Export Linux Build
|
|
run: |
|
|
mkdir -p build
|
|
godot --headless --export-release "Linux/X11" build/tekton_armageddon_linux.x86_64
|
|
|
|
- name: Zip Linux Build
|
|
run: cd build && zip tekton_armageddon_linux.zip tekton_armageddon_linux.x86_64
|
|
|
|
- name: Upload Linux Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux-build
|
|
path: build/tekton_armageddon_linux.zip
|
|
retention-days: 30
|
|
|
|
create-release:
|
|
needs: [build-windows, build-linux]
|
|
runs-on: ubuntu-latest
|
|
if: always() && startsWith(github.ref, 'refs/tags/')
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Extract Version
|
|
id: version
|
|
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
|
|
- 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.zip
|
|
linux-build/tekton_armageddon_linux.zip
|
|
draft: false
|
|
prerelease: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Mirror to tekton-updates
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_PAT }}
|
|
run: |
|
|
gh release create "v${{ steps.version.outputs.version }}" \
|
|
--repo "${{ github.actor }}/tekton-updates" \
|
|
--title "v${{ steps.version.outputs.version }}" \
|
|
--notes "Mirror of https://github.com/${{ github.repository }}/releases/tag/v${{ steps.version.outputs.version }}" \
|
|
"windows-build/tekton_armageddon_windows.zip#Windows" \
|
|
"linux-build/tekton_armageddon_linux.zip#Linux"
|