name: Release on: push: tags: - 'v*' jobs: export-windows: name: Export Windows runs-on: ubuntu-latest timeout-minutes: 45 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 with: ssh-key: ${{ secrets.TEKTON_SSH_KEY }} ssh-strict: false - name: Setup Godot run: | cp /cache/Godot_v4.6-stable_linux.x86_64.zip ./godot.zip 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 cp /cache/Godot_v4.6-stable_export_templates.tpz /tmp/godot-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 - name: Export Windows run: | mkdir -p build godot --headless --export-release "Windows Desktop" build/tekton_armageddon_windows.exe - uses: actions/upload-artifact@v4 with: name: tekton-windows path: build/tekton_armageddon_windows.exe retention-days: 7 export-linux: name: Export Linux runs-on: ubuntu-latest timeout-minutes: 45 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 with: ssh-key: ${{ secrets.TEKTON_SSH_KEY }} ssh-strict: false - name: Setup Godot run: | cp /cache/Godot_v4.6-stable_linux.x86_64.zip ./godot.zip 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 cp /cache/Godot_v4.6-stable_export_templates.tpz /tmp/godot-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 - name: Export Linux run: | mkdir -p build godot --headless --export-release "Linux/X11" build/tekton_armageddon_linux.x86_64 - name: Build PCK run: | godot --headless -s tools/build_patch.gd mkdir -p build mv patch.pck build/tekton_armageddon.pck 2>/dev/null || true - uses: actions/upload-artifact@v4 with: name: tekton-linux path: | build/tekton_armageddon_linux.x86_64 build/tekton_armageddon.pck retention-days: 7 release: name: Create Release runs-on: ubuntu-latest timeout-minutes: 15 needs: [export-windows, export-linux] permissions: contents: write steps: - uses: actions/download-artifact@v4 with: name: tekton-windows path: artifacts - uses: actions/download-artifact@v4 with: name: tekton-linux path: artifacts - name: Get or create Gitea release id: gitea_release env: GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }} TAG_NAME: ${{ github.ref_name }} run: | API="https://git.klud.top/api/v1/repos/danchie/tekton/releases" RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API/tags/$TAG_NAME") RELEASE_ID=$(echo "$RELEASE_JSON" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*') if [ -z "$RELEASE_ID" ]; then RELEASE_JSON=$(curl -s -X POST \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$TAG_NAME\"}" \ "$API") RELEASE_ID=$(echo "$RELEASE_JSON" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*') fi echo "release_id=$RELEASE_ID" >> "$GITHUB_OUTPUT" - name: Upload Windows asset run: | curl -X POST \ -H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \ -H "Content-Type: multipart/form-data" \ -F "attachment=@artifacts/tekton_armageddon_windows.exe" \ "https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets" - name: Upload Linux asset run: | curl -X POST \ -H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \ -H "Content-Type: multipart/form-data" \ -F "attachment=@artifacts/tekton_armageddon_linux.x86_64" \ "https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets" - name: Upload PCK asset run: | curl -X POST \ -H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \ -H "Content-Type: multipart/form-data" \ -F "attachment=@artifacts/tekton_armageddon.pck" \ "https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets"