chore(ci): use cached templates, build to zip, export windows/linux/macos with prefix
Release / Build & Release (push) Failing after 28s
Release / Build & Release (push) Failing after 28s
This commit is contained in:
+54
-22
@@ -14,7 +14,21 @@ jobs:
|
|||||||
GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }}
|
||||||
TAG_NAME: ${{ github.ref_name }}
|
TAG_NAME: ${{ github.ref_name }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Setup SSH
|
||||||
|
uses: webfactory/ssh-agent@v0.9.0
|
||||||
|
with:
|
||||||
|
ssh-private-key: ${{ secrets.TEKTON_SSH_KEY }}
|
||||||
|
|
||||||
|
- name: Add Gitea SSH Host Key
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
ssh-keyscan -p 222 thunderobot >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: danchie/tekton
|
||||||
|
ssh-key: ${{ secrets.TEKTON_SSH_KEY }}
|
||||||
|
|
||||||
- name: Install tools
|
- name: Install tools
|
||||||
run: apt-get update -qq && apt-get install -y -qq docker.io curl unzip
|
run: apt-get update -qq && apt-get install -y -qq docker.io curl unzip
|
||||||
@@ -22,33 +36,51 @@ jobs:
|
|||||||
- name: Connect job container to gitea_default network
|
- name: Connect job container to gitea_default network
|
||||||
run: docker network connect gitea_default $(hostname)
|
run: docker network connect gitea_default $(hostname)
|
||||||
|
|
||||||
- name: Setup Godot
|
- name: Setup Godot (Cached)
|
||||||
run: |
|
run: |
|
||||||
|
apt-get install -y zip
|
||||||
|
# Use cached godot engine binary
|
||||||
|
if [ ! -f /cache/godot_4.6 ]; then
|
||||||
|
echo "Downloading Godot 4.6..."
|
||||||
curl -sL -o /tmp/godot.zip "https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_linux.x86_64.zip"
|
curl -sL -o /tmp/godot.zip "https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_linux.x86_64.zip"
|
||||||
unzip -q -o /tmp/godot.zip -d /usr/local/bin
|
unzip -q -o /tmp/godot.zip -d /cache/
|
||||||
chmod +x /usr/local/bin/godot*
|
mv /cache/Godot_v4.6-stable_linux.x86_64 /cache/godot_4.6
|
||||||
mkdir -p /root/.godot/templates
|
fi
|
||||||
if [ -f /cache/Godot_v4.6-stable_export_templates.tpz ]; then
|
cp /cache/godot_4.6 /usr/local/bin/godot
|
||||||
cp /cache/Godot_v4.6-stable_export_templates.tpz /root/.godot/templates/
|
chmod +x /usr/local/bin/godot
|
||||||
else
|
|
||||||
curl -sL -o /root/.godot/templates/Godot_v4.6-stable_export_templates.tpz \
|
# Setup templates
|
||||||
|
mkdir -p ~/.local/share/godot/export_templates/4.6.stable.official
|
||||||
|
if [ ! -f /cache/Godot_v4.6-stable_export_templates.tpz ]; then
|
||||||
|
echo "Downloading templates..."
|
||||||
|
curl -sL -o /cache/Godot_v4.6-stable_export_templates.tpz \
|
||||||
"https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz"
|
"https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz"
|
||||||
fi
|
fi
|
||||||
cd /root/.godot/templates && unzip -q -o Godot_v4.6-stable_export_templates.tpz
|
cd ~/.local/share/godot/export_templates/4.6.stable.official
|
||||||
|
unzip -q -o /cache/Godot_v4.6-stable_export_templates.tpz
|
||||||
|
mv templates/* .
|
||||||
|
rm -rf templates
|
||||||
|
cd $GITHUB_WORKSPACE
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
|
|
||||||
- name: Export Windows
|
- name: Export Windows
|
||||||
run: |
|
run: |
|
||||||
cp addons/godotsteam/libgodotsteam* build/ 2>/dev/null || true
|
mkdir -p build/windows
|
||||||
godot --headless --export-release "Windows" build/tekton_armageddon_windows.exe 2>&1 | tail -5
|
cp addons/godotsteam/libgodotsteam* build/windows/ 2>/dev/null || true
|
||||||
|
godot --headless --export-release "Windows Desktop" build/windows/tekton_armageddon_windows_${TAG_NAME}.zip 2>&1 | tail -5
|
||||||
|
cd build/windows && zip -r ../tekton_armageddon_windows_${TAG_NAME}.zip .
|
||||||
|
|
||||||
- name: Export Linux
|
- name: Export Linux
|
||||||
run: godot --headless --export-release "Linux" build/tekton_armageddon_linux.x86_64 2>&1 | tail -5
|
|
||||||
|
|
||||||
- name: Build PCK
|
|
||||||
run: |
|
run: |
|
||||||
godot --headless --export-pack "Linux" build/tekton_armageddon.pck 2>&1 | tail -5
|
mkdir -p build/linux
|
||||||
ls -lh build/
|
godot --headless --export-release "Linux/X11" build/linux/tekton_armageddon_linux_${TAG_NAME}.zip 2>&1 | tail -5
|
||||||
|
cd build/linux && zip -r ../tekton_armageddon_linux_${TAG_NAME}.zip .
|
||||||
|
|
||||||
|
- name: Export macOS
|
||||||
|
run: |
|
||||||
|
mkdir -p build/macos
|
||||||
|
godot --headless --export-release "macOS" build/macos/tekton_armageddon_macos.zip 2>&1 | tail -5
|
||||||
|
mv build/macos/tekton_armageddon_macos.zip build/tekton_armageddon_macos_${TAG_NAME}.zip
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
run: |
|
run: |
|
||||||
@@ -84,7 +116,7 @@ jobs:
|
|||||||
curl -s -X POST \
|
curl -s -X POST \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: multipart/form-data" \
|
-H "Content-Type: multipart/form-data" \
|
||||||
-F "attachment=@build/tekton_armageddon_windows.exe" \
|
-F "attachment=@build/tekton_armageddon_windows_${TAG_NAME}.zip" \
|
||||||
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
|
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
|
||||||
echo "Windows uploaded"
|
echo "Windows uploaded"
|
||||||
|
|
||||||
@@ -94,19 +126,19 @@ jobs:
|
|||||||
curl -s -X POST \
|
curl -s -X POST \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: multipart/form-data" \
|
-H "Content-Type: multipart/form-data" \
|
||||||
-F "attachment=@build/tekton_armageddon_linux.x86_64" \
|
-F "attachment=@build/tekton_armageddon_linux_${TAG_NAME}.zip" \
|
||||||
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
|
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
|
||||||
echo "Linux uploaded"
|
echo "Linux uploaded"
|
||||||
|
|
||||||
- name: Upload PCK asset
|
- name: Upload macOS asset
|
||||||
run: |
|
run: |
|
||||||
RELEASE_ID=$(cat /tmp/release_id.txt)
|
RELEASE_ID=$(cat /tmp/release_id.txt)
|
||||||
curl -s -X POST \
|
curl -s -X POST \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: multipart/form-data" \
|
-H "Content-Type: multipart/form-data" \
|
||||||
-F "attachment=@build/tekton_armageddon.pck" \
|
-F "attachment=@build/tekton_armageddon_macos_${TAG_NAME}.zip" \
|
||||||
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
|
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
|
||||||
echo "PCK uploaded"
|
echo "macOS uploaded"
|
||||||
|
|
||||||
- name: Publish release
|
- name: Publish release
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user