From 0926b5f3dbc4827df1110e86c666cc21cea94399 Mon Sep 17 00:00:00 2001 From: Sch1nken Date: Sat, 14 Jun 2025 20:14:36 +0200 Subject: [PATCH] test workflow --- .forgejo/workflows/build.yml | 181 +++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 .forgejo/workflows/build.yml diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..4158da1 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,181 @@ +on: + workflow_dispatch: + inputs: + deploy-options: + description: 'Deploy target (none/itch)' + required: false + default: 'itch' + type: choice + options: + - itch + - none + +name: "Export" + +env: + GODOT_VERSION: 4.4.1 + EXPORT_NAME: gwj82 + PROJECT_PATH: . + +jobs: + delete-artifacts: + runs-on: ubuntu-latest + steps: + - uses: kolpav/purge-artifacts-action@v1 + with: + token: ${{ secrets.PAT }} + expire-in: 0days # Set this to 0 to delete all artifacts + + get-version: + name: Get Version + runs-on: ubuntu-latest + outputs: + version: ${{ steps.set_version.outputs.value }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set Version + id: set_version + run: | + VERSION_STRING=$(grep -oP 'config/version="\K(\d+\.\d+\.\d+)' project.godot) + echo "value=$VERSION_STRING" >> $GITHUB_OUTPUT + echo ${VERSION_STRING} + + export-windows: + name: Windows Export + runs-on: ubuntu-latest + needs: + - get-version + container: + image: barichello/godot-ci:4.4.1 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: true + submodules: true + - name: Setup + run: | + mkdir -v -p ~/.local/share/godot/export_templates/ + mkdir -v -p ~/.config/ + mv /root/.config/godot ~/.config/godot + mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable + - name: Windows Build + run: | + mkdir -v -p build/windows + EXPORT_DIR="$(readlink -f build)" + cd $PROJECT_PATH + godot --headless --verbose --export-release "Windows" "$EXPORT_DIR/windows/$EXPORT_NAME.exe" + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: "windows-${{ needs.get-version.outputs.version }}" + path: build/windows + + export-mac: + name: Mac Export + runs-on: ubuntu-latest + needs: + - get-version + container: + image: barichello/godot-ci:4.4.1 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: true + submodules: true + - name: Setup + run: | + mkdir -v -p ~/.local/share/godot/export_templates/ + mkdir -v -p ~/.config/ + mv /root/.config/godot ~/.config/godot + mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable + - name: Mac Build + run: | + mkdir -v -p build/windows + EXPORT_DIR="$(readlink -f build)" + cd $PROJECT_PATH + godot --headless --verbose --export-release "Mac" "$EXPORT_DIR/mac/$EXPORT_NAME.exe" + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: "mac-${{ needs.get-version.outputs.version }}" + path: build/mac + + export-linux: + needs: + - get-version + name: Linux Export + runs-on: ubuntu-latest + container: + image: barichello/godot-ci:4.4.1 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: true + submodules: true + - name: Setup + run: | + mkdir -v -p ~/.local/share/godot/export_templates/ + mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable + - name: Linux Build + run: | + mkdir -v -p build/linux + EXPORT_DIR="$(readlink -f build)" + cd $PROJECT_PATH + godot --headless --verbose --export-release "Linux" "$EXPORT_DIR/linux/$EXPORT_NAME.x86_64" + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: "linux-${{ needs.get-version.outputs.version }}" + path: build/linux + + export-web: + needs: + - get-version + name: Web Export + runs-on: ubuntu-latest + container: + image: barichello/godot-ci:4.4.1 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + lfs: true + submodules: true + - name: Setup + run: | + mkdir -v -p ~/.local/share/godot/export_templates/ + mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable + - name: Web Build + run: | + mkdir -v -p build/web + EXPORT_DIR="$(readlink -f build)" + cd $PROJECT_PATH + godot --headless --verbose --export-release "Web" "$EXPORT_DIR/web/index.html" + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: "web-${{ needs.get-version.outputs.version }}" + path: build/web + + trigger-deploy: + env: + DEPLOY_OPTIONS: ${{ github.event.inputs.deploy-options }} # Default to none + runs-on: ubuntu-latest + needs: + - get-version + - export-web + - export-windows + - export-linux + - export-mac + if: github.event.inputs.deploy-options == 'itch' + steps: + - name: Trigger deployment workflow + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: Deployment + token: ${{ secrets.PAT }} + inputs: '{"origin_run_id" : "${{ github.run_id }}", "project_version" : "${{ needs.get-version.outputs.version }}"}'