diff --git a/.gitea/workflows/build_artifacts.yml b/.gitea/workflows/build_artifacts.yml new file mode 100644 index 0000000..143c38b --- /dev/null +++ b/.gitea/workflows/build_artifacts.yml @@ -0,0 +1,122 @@ +name: Build Artifacts + +on: + workflow_dispatch: + inputs: + platform: + description: 'Platform to build' + required: true + type: choice + options: + - windows + - linux + - android + - all + version: + description: 'Version tag (optional)' + required: false + type: string + +jobs: + build-windows: + name: Build Windows + runs-on: ubuntu-latest + timeout-minutes: 45 + if: github.event.inputs.platform == 'windows' || github.event.inputs.platform == 'all' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install export templates + run: | + mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable + wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz + unzip -q Godot_v4.6-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.6.stable + + - name: Export Windows + run: | + godot --headless --export-release "Windows Desktop" build/tekton_armageddon_${{ github.event.inputs.version || 'dev' }}_windows.exe + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: tekton-windows-${{ github.event.inputs.version || 'dev' }} + path: build/tekton_armageddon_${{ github.event.inputs.version || 'dev' }}_windows.exe + retention-days: 30 + + build-linux: + name: Build Linux + runs-on: ubuntu-latest + timeout-minutes: 45 + if: github.event.inputs.platform == 'linux' || github.event.inputs.platform == 'all' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install export templates + run: | + mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable + wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz + unzip -q Godot_v4.6-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.6.stable + + - name: Export Linux + run: | + godot --headless --export-release "Linux/X11" build/tekton_armageddon_${{ github.event.inputs.version || 'dev' }}_linux.x86_64 + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: tekton-linux-${{ github.event.inputs.version || 'dev' }} + path: build/tekton_armageddon_${{ github.event.inputs.version || 'dev' }}_linux.x86_64 + retention-days: 30 + + build-android: + name: Build Android + runs-on: ubuntu-latest + timeout-minutes: 60 + if: github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install export templates + run: | + mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable + wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz + unzip -q Godot_v4.6-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.6.stable + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + with: + api-level: 34 + ndk-version: r26c + cmdline-tools-version: latest + + - name: Export Android + run: | + godot --headless --export-release "Android" build/tekton_dash_armageddon_${{ github.event.inputs.version || 'dev' }}.apk + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: tekton-android-${{ github.event.inputs.version || 'dev' }} + path: build/tekton_dash_armageddon_${{ github.event.inputs.version || 'dev' }}.apk + retention-days: 30 \ No newline at end of file diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..41158e0 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,171 @@ +name: CI + +on: + push: + branches: [main, experimental, patch-release] + pull_request: + branches: [main, experimental, patch-release] + +jobs: + test: + name: Run Tests + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install dependencies + run: | + # Install Godot headless dependencies + sudo apt-get update + sudo apt-get install -y libvulkan1 libx11-6 libxcursor1 libxi6 libxrandr2 libxinerama1 libxi6 libxxf86vm1 libgl1 + + - name: Run GUT tests + run: | + godot --headless -d --path . -s addons/gut/gut_cmdln.gd + + export-windows: + name: Export Windows + runs-on: ubuntu-latest + timeout-minutes: 45 + needs: test + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install export templates + run: | + mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable + wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz + unzip -q Godot_v4.6-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.6.stable + + - name: Export Windows + run: | + godot --headless --export-release "Windows Desktop" build/tekton_armageddon_windows.exe + + - name: Upload Windows artifact + 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 + needs: test + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install export templates + run: | + mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable + wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz + unzip -q Godot_v4.6-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.6.stable + + - name: Export Linux + run: | + godot --headless --export-release "Linux/X11" build/tekton_armageddon_linux.x86_64 + + - name: Upload Linux artifact + uses: actions/upload-artifact@v4 + with: + name: tekton-linux + path: build/tekton_armageddon_linux.x86_64 + retention-days: 7 + + export-android: + name: Export Android + runs-on: ubuntu-latest + timeout-minutes: 60 + needs: test + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install export templates + run: | + mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable + wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz + unzip -q Godot_v4.6-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.6.stable + + - name: Setup Android SDK + uses: android-actions/setup-android@v3 + with: + api-level: 34 + ndk-version: r26c + cmdline-tools-version: latest + + - name: Export Android + run: | + godot --headless --export-release "Android" build/tekton_dash_armageddon.apk + + - name: Upload Android artifact + uses: actions/upload-artifact@v4 + with: + name: tekton-android + path: build/tekton_dash_armageddon.apk + retention-days: 7 + + release: + name: Create Release + runs-on: ubuntu-latest + timeout-minutes: 15 + needs: [export-windows, export-linux, export-android] + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + permissions: + contents: write + steps: + - name: Download Windows artifact + uses: actions/download-artifact@v4 + with: + name: tekton-windows + path: artifacts/windows + + - name: Download Linux artifact + uses: actions/download-artifact@v4 + with: + name: tekton-linux + path: artifacts/linux + + - name: Download Android artifact + uses: actions/download-artifact@v4 + with: + name: tekton-android + path: artifacts/android + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + files: | + artifacts/windows/tekton_armageddon_windows.exe + artifacts/linux/tekton_armageddon_linux.x86_64 + artifacts/android/tekton_dash_armageddon.apk + generate_release_notes: true \ No newline at end of file diff --git a/.gitea/workflows/deploy_patch.yml b/.gitea/workflows/deploy_patch.yml new file mode 100644 index 0000000..8275e10 --- /dev/null +++ b/.gitea/workflows/deploy_patch.yml @@ -0,0 +1,83 @@ +name: Deploy Patch + +on: + workflow_dispatch: + inputs: + version: + description: 'Patch version (e.g., 2.4.2)' + required: true + type: string + notes: + description: 'Release notes' + required: false + type: string + +jobs: + build-patch: + name: Build Patch + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install export templates + run: | + mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable + wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz + unzip -q Godot_v4.6-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.6.stable + + - name: Run patch build script + run: | + python3 patch_version.py ${{ github.event.inputs.version }} "${{ github.event.inputs.notes }}" + + - name: Export Windows patch + run: | + godot --headless --export-release "Windows Desktop" build/tekton_armageddon_patch_windows.exe + + - name: Export Linux patch + run: | + godot --headless --export-release "Linux/X11" build/tekton_armageddon_patch_linux.x86_64 + + - name: Upload patch artifacts + uses: actions/upload-artifact@v4 + with: + name: tekton-patch-${{ github.event.inputs.version }} + path: | + build/tekton_armageddon_patch_windows.exe + build/tekton_armageddon_patch_linux.x86_64 + retention-days: 30 + + deploy-patch: + name: Deploy Patch + runs-on: ubuntu-latest + timeout-minutes: 15 + needs: build-patch + permissions: + contents: write + steps: + - name: Download patch artifacts + uses: actions/download-artifact@v4 + with: + name: tekton-patch-${{ github.event.inputs.version }} + path: artifacts/patch + + - name: Create patch release + uses: softprops/action-gh-release@v2 + with: + tag_name: patch-${{ github.event.inputs.version }} + name: "Patch ${{ github.event.inputs.version }}" + body: | + ${{ github.event.inputs.notes }} + files: | + artifacts/patch/tekton_armageddon_patch_windows.exe + artifacts/patch/tekton_armageddon_patch_linux.x86_64 + prerelease: true \ No newline at end of file diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..2597b26 --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,109 @@ +name: Test Suite + +on: + push: + branches: [main, experimental, patch-release] + pull_request: + branches: [main, experimental, patch-release] + workflow_dispatch: + +jobs: + unit-tests: + name: Unit Tests (GUT) + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y libvulkan1 libx11-6 libxcursor1 libxi6 libxrandr2 libxinerama1 libxi6 libxxf86vm1 libgl1 + + - name: Run GUT tests + run: | + godot --headless -d --path . -s addons/gut/gut_cmdln.gd + + integration-tests: + name: Integration Tests + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Install export templates + run: | + mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable + wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz + unzip -q Godot_v4.6-stable_export_templates.tpz -d ~/.local/share/godot/export_templates/4.6.stable + + - name: Export headless server for integration tests + run: | + godot --headless --export-release "Linux/X11" build/tekton_server.x86_64 + + - name: Run integration tests + run: | + # Start server in background + ./build/tekton_server.x86_64 --headless --port 7777 & + SERVER_PID=$! + sleep 5 + + # Run client tests against server + godot --headless -d --path . -s addons/gut/gut_cmdln.gd --select=test_integration + + # Cleanup + kill $SERVER_PID + + lint: + name: Code Style Check + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Godot + uses: firebelley/godot-action@v3 + with: + godot-version: '4.6' + engine-type: standard + + - name: Check GDScript formatting + run: | + godot --headless --check-only -s scripts/lint.gd || true + # Note: GDScript doesn't have a built-in formatter; this checks syntax only + + security-scan: + name: Security Scan + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: 'fs' + scan-ref: '.' + format: 'sarif' + output: 'trivy-results.sarif' + + - name: Upload Trivy results to GitHub Security + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: 'trivy-results.sarif' \ No newline at end of file