handroll custom action based on mlm-games/godot-build-action
This commit is contained in:
parent
562bb06559
commit
7cf5a8953b
@ -1,9 +1,14 @@
|
||||
name: Build Godot Project1
|
||||
|
||||
on:
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
- 'v*'
|
||||
|
||||
env:
|
||||
GODOT_VERSION: 4.4
|
||||
PROJECT_NAME: batrix
|
||||
EXPORT_DIR: builds
|
||||
|
||||
jobs:
|
||||
godot:
|
||||
@ -12,31 +17,64 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- preset: linux
|
||||
export_file: batrix.x86_64
|
||||
export_file: ${PROJECT_NAME}.x86_64
|
||||
- preset: windows
|
||||
export_file: batrix.exe
|
||||
export_file: ${PROJECT_NAME}.exe
|
||||
- preset: mac
|
||||
export_file: batrix.zip
|
||||
export_file: ${PROJECT_NAME}.zip
|
||||
permissions: write-all
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
|
||||
- name: Export from Godot
|
||||
uses: mlm-games/godot-build-action@v1
|
||||
with:
|
||||
BINARY_NAME: batrix
|
||||
EXPORT_PRESET_NAME: ${{ matrix.preset }}
|
||||
EXPORT_DIR: build
|
||||
|
||||
- name: Create directories
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/.local/share/godot/export_templates/$(echo ${GODOT_VERSION} | sed 's/[^a-zA-Z0-9_]/./g')
|
||||
mkdir -p ~/godot-binary
|
||||
|
||||
- name: Download Godot
|
||||
shell: bash
|
||||
run: |
|
||||
GODOT_BASENAME="Godot_v${GODOT_VERSION}_linux.x86_64"
|
||||
wget -q "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/${GODOT_BASENAME}.zip" -O ~/godot-binary/godot.zip
|
||||
unzip -q ~/godot-binary/godot.zip -d ~/godot-binary
|
||||
chmod +x ~/godot-binary/${GODOT_BASENAME}
|
||||
mv ~/godot-binary/${GODOT_BASENAME} ~/godot-binary/godot
|
||||
|
||||
- name: Download and install export templates
|
||||
shell: bash
|
||||
run: |
|
||||
TEMPLATES_BASENAME="Godot_v${GODOT_VERSION}_export_templates"
|
||||
wget -q "https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}/${TEMPLATES_BASENAME}.tpz" -O ~/templates.tpz
|
||||
unzip -q ~/templates.tpz -d ~/.local/share/godot/export_templates/temp
|
||||
mkdir -p ~/.local/share/godot/export_templates/$(echo ${GODOT_VERSION} | sed 's/[^a-zA-Z0-9_]/./g')
|
||||
mv ~/.local/share/godot/export_templates/temp/templates/* ~/.local/share/godot/export_templates/$(echo ${GODOT_VERSION} | sed 's/[^a-zA-Z0-9_]/./g')/
|
||||
|
||||
- name: Export project
|
||||
id: export
|
||||
shell: bash
|
||||
run: |
|
||||
BUILD_PATH="${GITHUB_WORKSPACE}/${EXPORT_DIR}/"
|
||||
echo "build=${BUILD_PATH}" >> $GITHUB_OUTPUT
|
||||
|
||||
echo "Building for ${{ matrix.preset }}"
|
||||
cd "${GITHUB_WORKSPACE}"
|
||||
~/godot-binary/godot --headless --export-release "${{ matrix.preset }}"
|
||||
echo "Build Done"
|
||||
|
||||
- name: Zip
|
||||
uses: montudor/action-zip@v0.1.1
|
||||
with:
|
||||
args: >-
|
||||
zip --junk-paths --recurse-paths
|
||||
build/batrix-${{ env.version }}-${{ matrix.preset }}.zip
|
||||
build/${{ matrix.preset }}
|
||||
${EXPORT_DIR}/${PROJECT_NAME}-${{ env.version }}-${{ matrix.preset }}.zip
|
||||
${EXPORT_DIR}/${{ matrix.preset }}
|
||||
|
||||
- name: Release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
files: build/*.zip
|
||||
files: ${EXPORT_DIR}/*.zip
|
||||
|
||||
Loading…
Reference in New Issue
Block a user