This commit is contained in:
parent
770a1f7fd3
commit
0926b5f3db
1 changed files with 181 additions and 0 deletions
181
.forgejo/workflows/build.yml
Normal file
181
.forgejo/workflows/build.yml
Normal file
|
|
@ -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 }}"}'
|
||||
Loading…
Add table
Add a link
Reference in a new issue