116 lines
3.9 KiB
YAML
116 lines
3.9 KiB
YAML
#
|
|
# .gitea/gitea-ci.yaml
|
|
#
|
|
#
|
|
|
|
name: "godot-ci export"
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*.*'
|
|
#on: push
|
|
|
|
env:
|
|
GODOT_VERSION: 4.3
|
|
PROJECT_PATH: .
|
|
#GAME_VERSION: 0.0.8
|
|
GAME_VERSION: ${{gitea.ref_name}}
|
|
EXPORT_NAME: test-project
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download Godot
|
|
run: |
|
|
echo "https://github.com/godotengine/godot-builds/releases/download/$GODOT_VERSION-stable/Godot_v$GODOT_VERSION-stable_linux.x86_64.zip"
|
|
curl -L -o godot.zip https://github.com/godotengine/godot-builds/releases/download/$GODOT_VERSION-stable/Godot_v$GODOT_VERSION-stable_linux.x86_64.zip
|
|
unzip godot.zip
|
|
mv Godot_v$GODOT_VERSION-stable_linux.x86_64 godot
|
|
chmod +x godot
|
|
|
|
- name: Download Godot Export Templates
|
|
run: |
|
|
echo "https://github.com/godotengine/godot-builds/releases/download/$GODOT_VERSION-stable/Godot_v$GODOT_VERSION-stable_export_templates.tpz"
|
|
curl -L -o export_templates.zip https://github.com/godotengine/godot-builds/releases/download/$GODOT_VERSION-stable/Godot_v$GODOT_VERSION-stable_export_templates.tpz
|
|
unzip export_templates.zip
|
|
|
|
- name: Install Export Templates
|
|
run: |
|
|
mkdir -p ~/.local/share/godot/export_templates/$GODOT_VERSION.stable
|
|
mv ./templates/* ~/.local/share/godot/export_templates/$GODOT_VERSION.stable
|
|
|
|
- name: Windows Build
|
|
run: |
|
|
mkdir -v -p build
|
|
cd $PROJECT_PATH
|
|
./godot --headless --verbose --export-release "Windows Desktop" "build/$EXPORT_NAME"_"$GAME_VERSION.exe"
|
|
|
|
- name: Linux Build
|
|
run: |
|
|
mkdir -v -p build
|
|
cd $PROJECT_PATH
|
|
./godot --headless --verbose --export-release "Linux/X11" "build/$EXPORT_NAME"_"$GAME_VERSION.x86_64"
|
|
|
|
- name: MacOS Build
|
|
run: |
|
|
mkdir -v -p build
|
|
cd $PROJECT_PATH
|
|
./godot --headless --verbose --export-release "macOS" "build/$EXPORT_NAME"_"$GAME_VERSION.zip"
|
|
|
|
- name: Upload Artifact Windows
|
|
run: |
|
|
ls -la build
|
|
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
|
|
--upload-file "build/$EXPORT_NAME"_"$GAME_VERSION.exe" \
|
|
https://gitea.sanplex.tech/api/packages/sansan/generic/GodotTest/$GAME_VERSION/$EXPORT_NAME"_"$GAME_VERSION.exe
|
|
|
|
- name: Upload Artifact Linux
|
|
run: |
|
|
ls -la build
|
|
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
|
|
--upload-file "build/$EXPORT_NAME"_"$GAME_VERSION.x86_64" \
|
|
https://gitea.sanplex.tech/api/packages/sansan/generic/GodotTest/$GAME_VERSION/$EXPORT_NAME"_"$GAME_VERSION.x86_64
|
|
|
|
- name: Upload Artifact MacOS
|
|
run: |
|
|
ls -la build
|
|
curl --user ${{ github.repository_owner }}:${{ secrets.TOKEN }} \
|
|
--upload-file "build/$EXPORT_NAME"_"$GAME_VERSION.zip" \
|
|
https://gitea.sanplex.tech/api/packages/sansan/generic/GodotTest/$GAME_VERSION/$EXPORT_NAME"_"$GAME_VERSION.zip
|
|
|
|
- name: Create release
|
|
uses: akkuman/gitea-release-action@v1
|
|
env:
|
|
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
|
with:
|
|
files: |-
|
|
build/**
|
|
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: windows
|
|
# path: build/windows
|
|
|
|
#- name: Upload Artifact
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: linux
|
|
# path: build/linux
|
|
|
|
#- name: Zip HTML Export
|
|
# run: |
|
|
# cd exports/html
|
|
# zip $PROJECT_NAME-html.zip -r -m *
|
|
# mv $PROJECT_NAME-html.zip ..
|
|
# cd -
|
|
|
|
#- name: Save Artifacts for Next Job
|
|
# uses: actions/upload-artifact@v3
|
|
# with:
|
|
# name: exports
|
|
# path: exports
|