chore(ci): docker network connect gitea_default for API access
Release / Build & Release (push) Failing after 54s
Release / Build & Release (push) Failing after 54s
This commit is contained in:
+67
-56
@@ -10,99 +10,110 @@ jobs:
|
|||||||
name: Build & Release
|
name: Build & Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }}
|
||||||
|
TAG_NAME: ${{ github.ref_name }}
|
||||||
steps:
|
steps:
|
||||||
- name: Setup SSH config for Gitea
|
|
||||||
run: |
|
|
||||||
echo -e "Host gitea\n HostName 100.79.174.108\n Port 222\n StrictHostKeyChecking no" >> /etc/ssh/ssh_config
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
ssh-key: ${{ secrets.TEKTON_SSH_KEY }}
|
- name: Install tools
|
||||||
ssh-strict: false
|
run: apt-get update -qq && apt-get install -y -qq docker.io curl unzip
|
||||||
|
|
||||||
|
- name: Connect job container to gitea_default network
|
||||||
|
run: docker network connect gitea_default $(hostname)
|
||||||
|
|
||||||
- name: Setup Godot
|
- name: Setup Godot
|
||||||
run: |
|
run: |
|
||||||
if [ -f /cache/Godot_v4.6-stable_linux.x86_64.zip ]; then
|
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"
|
||||||
cp /cache/Godot_v4.6-stable_linux.x86_64.zip ./godot.zip
|
unzip -q -o /tmp/godot.zip -d /usr/local/bin
|
||||||
else
|
chmod +x /usr/local/bin/godot*
|
||||||
wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_linux.x86_64.zip -O godot.zip
|
mkdir -p /root/.godot/templates
|
||||||
fi
|
|
||||||
unzip -q godot.zip
|
|
||||||
mv Godot_v4.6-stable_linux.x86_64 /usr/local/bin/godot
|
|
||||||
chmod +x /usr/local/bin/godot
|
|
||||||
|
|
||||||
- name: Install export templates
|
|
||||||
run: |
|
|
||||||
mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable
|
|
||||||
if [ -f /cache/Godot_v4.6-stable_export_templates.tpz ]; then
|
if [ -f /cache/Godot_v4.6-stable_export_templates.tpz ]; then
|
||||||
cp /cache/Godot_v4.6-stable_export_templates.tpz /tmp/godot-templates.tpz
|
cp /cache/Godot_v4.6-stable_export_templates.tpz /root/.godot/templates/
|
||||||
else
|
else
|
||||||
wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz -O /tmp/godot-templates.tpz
|
curl -sL -o /root/.godot/templates/Godot_v4.6-stable_export_templates.tpz \
|
||||||
fi
|
"https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz"
|
||||||
unzip -o -q /tmp/godot-templates.tpz -d /tmp/godot-templates
|
|
||||||
if [ -d /tmp/godot-templates/templates ]; then
|
|
||||||
cp -a /tmp/godot-templates/templates/* ~/.local/share/godot/export_templates/4.6.stable/
|
|
||||||
else
|
|
||||||
cp -a /tmp/godot-templates/* ~/.local/share/godot/export_templates/4.6.stable/
|
|
||||||
fi
|
fi
|
||||||
|
cd /root/.godot/templates && unzip -q -o Godot_v4.6-stable_export_templates.tpz
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
- name: Export Windows
|
- name: Export Windows
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build
|
cp addons/godotsteam/libgodotsteam* build/ 2>/dev/null || true
|
||||||
godot --headless --export-release "Windows Desktop" build/tekton_armageddon_windows.exe
|
godot --headless --export-release "Windows" build/tekton_armageddon_windows.exe 2>&1 | tail -5
|
||||||
|
|
||||||
- name: Export Linux
|
- name: Export Linux
|
||||||
run: |
|
run: godot --headless --export-release "Linux" build/tekton_armageddon_linux.x86_64 2>&1 | tail -5
|
||||||
godot --headless --export-release "Linux/X11" build/tekton_armageddon_linux.x86_64
|
|
||||||
|
|
||||||
- name: Build PCK
|
- name: Build PCK
|
||||||
run: |
|
run: |
|
||||||
godot --headless -s tools/build_patch.gd
|
godot --headless --export-pack "Linux" build/tekton_armageddon.pck 2>&1 | tail -5
|
||||||
mkdir -p build
|
ls -lh build/
|
||||||
mv patch.pck build/tekton_armageddon.pck 2>/dev/null || true
|
|
||||||
|
|
||||||
- name: List build artifacts
|
- name: Create Gitea Release
|
||||||
run: ls -lh build/
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
id: gitea_release
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }}
|
|
||||||
TAG_NAME: ${{ github.ref_name }}
|
|
||||||
run: |
|
run: |
|
||||||
API="https://git.klud.top/api/v1/repos/danchie/tekton/releases"
|
set -e
|
||||||
RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API/tags/$TAG_NAME")
|
API="http://gitea:3000/api/v1/repos/danchie/tekton/releases"
|
||||||
RELEASE_ID=$(echo "$RELEASE_JSON" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
|
TAG="$TAG_NAME"
|
||||||
|
|
||||||
|
echo "Checking existing release for $TAG..."
|
||||||
|
RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API/tags/$TAG")
|
||||||
|
RELEASE_ID=$(echo "$RELEASE_JSON" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*' || true)
|
||||||
|
|
||||||
if [ -z "$RELEASE_ID" ]; then
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
|
echo "Creating new release for $TAG..."
|
||||||
RELEASE_JSON=$(curl -s -X POST \
|
RELEASE_JSON=$(curl -s -X POST \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$TAG_NAME\"}" \
|
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"draft\":true}" \
|
||||||
"$API")
|
"$API")
|
||||||
|
echo "API response: $RELEASE_JSON"
|
||||||
RELEASE_ID=$(echo "$RELEASE_JSON" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
|
RELEASE_ID=$(echo "$RELEASE_JSON" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
|
||||||
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
|
echo "FATAL: Could not create release"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo "release_id=$RELEASE_ID" >> "$GITHUB_OUTPUT"
|
|
||||||
|
echo "release_id=$RELEASE_ID"
|
||||||
|
echo "$RELEASE_ID" > /tmp/release_id.txt
|
||||||
|
|
||||||
- name: Upload Windows asset
|
- name: Upload Windows asset
|
||||||
run: |
|
run: |
|
||||||
curl -X POST \
|
RELEASE_ID=$(cat /tmp/release_id.txt)
|
||||||
-H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \
|
curl -s -X POST \
|
||||||
|
-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.exe" \
|
||||||
"https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets"
|
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
|
||||||
|
echo "Windows uploaded"
|
||||||
|
|
||||||
- name: Upload Linux asset
|
- name: Upload Linux asset
|
||||||
run: |
|
run: |
|
||||||
curl -X POST \
|
RELEASE_ID=$(cat /tmp/release_id.txt)
|
||||||
-H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \
|
curl -s -X POST \
|
||||||
|
-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.x86_64" \
|
||||||
"https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets"
|
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
|
||||||
|
echo "Linux uploaded"
|
||||||
|
|
||||||
- name: Upload PCK asset
|
- name: Upload PCK asset
|
||||||
run: |
|
run: |
|
||||||
curl -X POST \
|
RELEASE_ID=$(cat /tmp/release_id.txt)
|
||||||
-H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \
|
curl -s -X POST \
|
||||||
|
-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.pck" \
|
||||||
"https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets"
|
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID/assets"
|
||||||
|
echo "PCK uploaded"
|
||||||
|
|
||||||
|
- name: Publish release
|
||||||
|
run: |
|
||||||
|
RELEASE_ID=$(cat /tmp/release_id.txt)
|
||||||
|
curl -s -X PATCH \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"draft":false}' \
|
||||||
|
"http://gitea:3000/api/v1/repos/danchie/tekton/releases/$RELEASE_ID"
|
||||||
|
echo "Published: https://git.klud.top/danchie/tekton/releases/tag/$TAG_NAME"
|
||||||
|
|||||||
Reference in New Issue
Block a user