commit b1709a3711fda316911b2fae5b1e3f448163497e Author: Damien Ostler Date: Sun Jan 7 02:17:59 2024 -0500 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.github/workflows/game_ci.yml b/.github/workflows/game_ci.yml new file mode 100644 index 0000000..bc8cb66 --- /dev/null +++ b/.github/workflows/game_ci.yml @@ -0,0 +1,202 @@ +name: "Godot 4.1.2 CI/CD" + +env: + GODOT_VERSION: 4.1.2 + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + web: + runs-on: ubuntu-latest + permissions: + contents: write + container: + image: barichello/godot-ci:4.1.2 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/web + + - name: Build + run: godot -v --export-release --headless "Web" + + - name: Add coi-service-worker + run: | + git clone https://github.com/gzuidhof/coi-serviceworker.git + mv coi-serviceworker/coi-serviceworker.js build/web/coi-serviceworker.js + sed -i '3 i ' build/web/index.html + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3.9.3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/web + force_orphan: true + user_name: "github-ci[bot]" + user_email: "github-actions[bot]@users.noreply.github.com" + commit_message: "UPDATE GITHUB PAGES" + + - name: Zip Web artifacts + run: zip -r game_web.zip build/web + + - name: Upload Web artifacts + uses: actions/upload-artifact@v3 + with: + name: game_web + path: game_web.zip + linux: + runs-on: ubuntu-latest + permissions: + contents: write + + container: + image: barichello/godot-ci:4.1.2 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/linux + + - name: Build for Linux + run: godot -v --export-release --headless "Linux/X11" --path . --output "build/linux/game.x86_64" + + - name: Zip Linux artifacts + run: zip -r game_linux.zip build/linux + + - name: Upload Linux artifacts + uses: actions/upload-artifact@v3 + with: + name: game_linux + path: game_linux.zip + windows: + runs-on: ubuntu-latest + permissions: + contents: write + + container: + image: barichello/godot-ci:4.1.2 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/windows + + - name: Build for windows + run: godot -v --export-release --headless "Windows Desktop" --path . --output "build/windows/game.x86_64" + + - name: Zip Windows artifacts + run: zip -r game_windows.zip build/windows + + - name: Upload windows artifacts + uses: actions/upload-artifact@v3 + with: + name: game_windows + path: game_windows.zip + release: + needs: [web, linux, windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: '5.x' + + - name: Execute GitVersion + uses: gittools/actions/gitversion/execute@v0.9.15 + with: + useConfigFile: true + configFilePath: GitVersion.yml + + - name: Get branch name + id: get_branch + run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: game_web + + - name: Download Linux artifacts + uses: actions/download-artifact@v3 + with: + name: game_linux + + - name: Download Windows artifacts + uses: actions/download-artifact@v3 + with: + name: game_windows + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{env.GitVersion_MajorMinorPatch}} + release_name: ${{env.GitVersion_MajorMinorPatch}} + body: | + Release notes for ${{env.GitVersion_MajorMinorPatch}} + draft: false + prerelease: false + + - name: Upload Web Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_web.zip + asset_name: Godot_Game_Web.zip + asset_content_type: application/zip + + - name: Upload Linux Release Asset + id: upload-linux-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_linux.zip + asset_name: Godot_Game_Linux.zip + asset_content_type: application/zip + + - name: Upload Windows Release Asset + id: upload-windows-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_windows.zip + asset_name: Godot_Game_Windows.zip + asset_content_type: application/zip \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4709183 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Godot 4+ specific ignores +.godot/ diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..4555bf4 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,10 @@ +assembly-versioning-scheme: MajorMinorPatch +mode: ContinuousDelivery +branches: {} +ignore: + sha: [] +merge-message-formats: {} +commit-message-incrementing: Enabled +major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)" +minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:" +patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:" \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c69e3d5 --- /dev/null +++ b/README.md @@ -0,0 +1,686 @@ +# Overview +This is a repository that provides a template for you to start your Godot repositories on GitHub. This repository contains a basic project setup along with CI/CD. By default it will build for windows, linux and the web and upload their artifacts, along with deploying a build to GitHub Pages. + +Example Deployment https://damientehdemon.github.io/godot_template/ +# Recommended Flow +To use this properly we recommend creating pull requests into the main branch, and merging your changes in that way. We recommend making a small change to the workflow file in `/.github/workflows/game_ci.yaml` and changing line `169` from `prerelease: false` to `prerelease: true`. Whenever you want to do a proper release, you can go to the list of releases on your repository and change it to be a full release instead of pre-release. This will allow you to have builds for every version of the game, while also maintaining a selection of stable builds. +# Requirments +In order for the workflows in this repository to work with an existing project it requires certain export profiles to be configured. You need to have a windows, linux, and web export configured using the default names: "Windows Desktop","Linux/X11", and "Web". +# Migrating existing project +If you want to add this to an existing GitHub repository, just copy and paste the `.github` folder into the root of your existing repository. As long as your project has these exports and resides in the root of the repository the GitHub workflows should work fine. +# Versioning +When you push to the `main` branch the workflow will automatically be executed. The workflow will build for Web,Linux, and Windows, and then upload the build artifacts to the workflow. Then a new step will execute which will generate version numbers based on the commits. You can see below which keywords a commit message must start with to increment a major,minor, or patch number. At the end the workflow will create a release and upload the build artifacts to it. + +The keywords for versioning are configured in the `GitVersion.yaml` in the root of the repository. This is the default value. + +https://gitversion.net/docs/reference/configuration + +``` +assembly-versioning-scheme: MajorMinorPatch +mode: ContinuousDelivery +branches: {} +ignore: + sha: [] +merge-message-formats: {} +commit-message-incrementing: Enabled +major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)" +minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:" +patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:" +``` +# Alternative Workflows +In order to use these just place a file in the `/.github/workflows/` folder with the contents below. Make sure that it has the file extension .yml. +### Web,Linux,Windows - No GitHub Pages CI +``` +name: "Godot 4.1.2 CI/CD" + +env: + GODOT_VERSION: 4.1.2 + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + web: + runs-on: ubuntu-latest + permissions: + contents: write + container: + image: barichello/godot-ci:4.1.2 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/web + + - name: Build + run: godot -v --export-release --headless "Web" + + - name: Add coi-service-worker + run: | + git clone https://github.com/gzuidhof/coi-serviceworker.git + mv coi-serviceworker/coi-serviceworker.js build/web/coi-serviceworker.js + sed -i '3 i ' build/web/index.html + + - name: Zip Web artifacts + run: zip -r game_web.zip build/web + + - name: Upload Web artifacts + uses: actions/upload-artifact@v3 + with: + name: game_web + path: game_web.zip + linux: + runs-on: ubuntu-latest + permissions: + contents: write + + container: + image: barichello/godot-ci:4.1.2 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/linux + + - name: Build for Linux + run: godot -v --export-release --headless "Linux/X11" --path . --output "build/linux/game.x86_64" + + - name: Zip Linux artifacts + run: zip -r game_linux.zip build/linux + + - name: Upload Linux artifacts + uses: actions/upload-artifact@v3 + with: + name: game_linux + path: game_linux.zip + windows: + runs-on: ubuntu-latest + permissions: + contents: write + + container: + image: barichello/godot-ci:4.1.2 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/windows + + - name: Build for windows + run: godot -v --export-release --headless "Windows Desktop" --path . --output "build/windows/game.x86_64" + + - name: Zip Windows artifacts + run: zip -r game_windows.zip build/windows + + - name: Upload windows artifacts + uses: actions/upload-artifact@v3 + with: + name: game_windows + path: game_windows.zip + release: + needs: [web, linux, windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: '5.x' + + - name: Execute GitVersion + uses: gittools/actions/gitversion/execute@v0.9.15 + with: + useConfigFile: true + configFilePath: GitVersion.yml + + - name: Get branch name + id: get_branch + run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: game_web + + - name: Download Linux artifacts + uses: actions/download-artifact@v3 + with: + name: game_linux + + - name: Download Windows artifacts + uses: actions/download-artifact@v3 + with: + name: game_windows + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{env.GitVersion_MajorMinorPatch}} + release_name: ${{env.GitVersion_MajorMinorPatch}} + body: | + Release notes for ${{env.GitVersion_MajorMinorPatch}} + draft: false + prerelease: false + + - name: test + run: ls + + - name: Upload Web Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_web.zip + asset_name: Godot_Game_Web.zip + asset_content_type: application/zip + + - name: Upload Linux Release Asset + id: upload-linux-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_linux.zip + asset_name: Godot_Game_Linux.zip + asset_content_type: application/zip + + - name: Upload Windows Release Asset + id: upload-windows-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_windows.zip + asset_name: Godot_Game_Windows.zip + asset_content_type: application/zip +``` +### Web Only - GitHub Pages CI +```name: "Godot 4.1.2 CI/CD" + +env: + GODOT_VERSION: 4.1.2 + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + web: + runs-on: ubuntu-latest + permissions: + contents: write + container: + image: barichello/godot-ci:4.1.2 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/web + + - name: Build + run: godot -v --export-release --headless "Web" + + - name: Add coi-service-worker + run: | + git clone https://github.com/gzuidhof/coi-serviceworker.git + mv coi-serviceworker/coi-serviceworker.js build/web/coi-serviceworker.js + sed -i '3 i ' build/web/index.html + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3.9.3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/web + force_orphan: true + user_name: "github-ci[bot]" + user_email: "github-actions[bot]@users.noreply.github.com" + commit_message: "UPDATE GITHUB PAGES" + + - name: Zip Web artifacts + run: zip -r game_web.zip build/web + + - name: Upload Web artifacts + uses: actions/upload-artifact@v3 + with: + name: game_web + path: game_web.zip + release: + needs: [web, linux, windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: '5.x' + + - name: Execute GitVersion + uses: gittools/actions/gitversion/execute@v0.9.15 + with: + useConfigFile: true + configFilePath: GitVersion.yml + + - name: Get branch name + id: get_branch + run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: game_web + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{env.GitVersion_MajorMinorPatch}} + release_name: ${{env.GitVersion_MajorMinorPatch}} + body: | + Release notes for ${{env.GitVersion_MajorMinorPatch}} + draft: false + prerelease: false + + - name: test + run: ls + + - name: Upload Web Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_web.zip + asset_name: Godot_Game_Web.zip + asset_content_type: application/zip +``` +### Linux,Windows Only +```name: "Godot 4.1.2 CI/CD" + +env: + GODOT_VERSION: 4.1.2 + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + linux: + runs-on: ubuntu-latest + permissions: + contents: write + + container: + image: barichello/godot-ci:4.1.2 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/linux + + - name: Build for Linux + run: godot -v --export-release --headless "Linux/X11" --path . --output "build/linux/game.x86_64" + + - name: Zip Linux artifacts + run: zip -r game_linux.zip build/linux + + - name: Upload Linux artifacts + uses: actions/upload-artifact@v3 + with: + name: game_linux + path: game_linux.zip + windows: + runs-on: ubuntu-latest + permissions: + contents: write + + container: + image: barichello/godot-ci:4.1.2 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/windows + + - name: Build for windows + run: godot -v --export-release --headless "Windows Desktop" --path . --output "build/windows/game.x86_64" + + - name: Zip Windows artifacts + run: zip -r game_windows.zip build/windows + + - name: Upload windows artifacts + uses: actions/upload-artifact@v3 + with: + name: game_windows + path: game_windows.zip + release: + needs: [web, linux, windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: '5.x' + + - name: Execute GitVersion + uses: gittools/actions/gitversion/execute@v0.9.15 + with: + useConfigFile: true + configFilePath: GitVersion.yml + + - name: Get branch name + id: get_branch + run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + + - name: Download Linux artifacts + uses: actions/download-artifact@v3 + with: + name: game_linux + + - name: Download Windows artifacts + uses: actions/download-artifact@v3 + with: + name: game_windows + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{env.GitVersion_MajorMinorPatch}} + release_name: ${{env.GitVersion_MajorMinorPatch}} + body: | + Release notes for ${{env.GitVersion_MajorMinorPatch}} + draft: false + prerelease: false + + - name: Upload Linux Release Asset + id: upload-linux-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_linux.zip + asset_name: Godot_Game_Linux.zip + asset_content_type: application/zip + + - name: Upload Windows Release Asset + id: upload-windows-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_windows.zip + asset_name: Godot_Game_Windows.zip + asset_content_type: application/zip +``` +### Linux Only +``` +name: "Godot 4.1.2 CI/CD" + +env: + GODOT_VERSION: 4.1.2 + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + linux: + runs-on: ubuntu-latest + permissions: + contents: write + + container: + image: barichello/godot-ci:4.1.2 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/linux + + - name: Build for Linux + run: godot -v --export-release --headless "Linux/X11" --path . --output "build/linux/game.x86_64" + + - name: Zip Linux artifacts + run: zip -r game_linux.zip build/linux + + - name: Upload Linux artifacts + uses: actions/upload-artifact@v3 + with: + name: game_linux + path: game_linux.zip + release: + needs: [web, linux, windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: '5.x' + + - name: Execute GitVersion + uses: gittools/actions/gitversion/execute@v0.9.15 + with: + useConfigFile: true + configFilePath: GitVersion.yml + + - name: Get branch name + id: get_branch + run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + + - name: Download Linux artifacts + uses: actions/download-artifact@v3 + with: + name: game_linux + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{env.GitVersion_MajorMinorPatch}} + release_name: ${{env.GitVersion_MajorMinorPatch}} + body: | + Release notes for ${{env.GitVersion_MajorMinorPatch}} + draft: false + prerelease: false + + - name: Upload Linux Release Asset + id: upload-linux-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_linux.zip + asset_name: Godot_Game_Linux.zip + asset_content_type: application/zip +``` +### Windows Only +``` +name: "Godot 4.1.2 CI/CD" + +env: + GODOT_VERSION: 4.1.2 + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + windows: + runs-on: ubuntu-latest + permissions: + contents: write + + container: + image: barichello/godot-ci:4.1.2 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Move export templates into position + 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: Create staging directory + run: mkdir -v -p build/windows + + - name: Build for windows + run: godot -v --export-release --headless "Windows Desktop" --path . --output "build/windows/game.x86_64" + + - name: Zip Windows artifacts + run: zip -r game_windows.zip build/windows + + - name: Upload windows artifacts + uses: actions/upload-artifact@v3 + with: + name: game_windows + path: game_windows.zip + release: + needs: [web, linux, windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up GitVersion + uses: gittools/actions/gitversion/setup@v0.9.15 + with: + versionSpec: '5.x' + + - name: Execute GitVersion + uses: gittools/actions/gitversion/execute@v0.9.15 + with: + useConfigFile: true + configFilePath: GitVersion.yml + + - name: Get branch name + id: get_branch + run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + + - name: Download Windows artifacts + uses: actions/download-artifact@v3 + with: + name: game_windows + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{env.GitVersion_MajorMinorPatch}} + release_name: ${{env.GitVersion_MajorMinorPatch}} + body: | + Release notes for ${{env.GitVersion_MajorMinorPatch}} + draft: false + prerelease: false + + - name: Upload Windows Release Asset + id: upload-windows-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: game_windows.zip + asset_name: Godot_Game_Windows.zip + asset_content_type: application/zip +``` diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..925112e --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,521 @@ +[preset.0] + +name="Web" +platform="Web" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="build/web/index.html" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +variant/extensions_support=false +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=false +html/export_icon=true +html/custom_html_shell="" +html/head_include="" +html/canvas_resize_policy=2 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=false +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=0 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color(0, 0, 0, 1) + +[preset.1] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="build/linux/game.exe" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=true +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks="" +application/export_angle=0 +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" + +[preset.2] + +name="Linux/X11" +platform="Linux/X11" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="build/linux/game.x86_64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.2.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" + +[preset.3] + +name="iOS" +platform="iOS" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="build/ios/game.ipa" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.3.options] + +custom_template/debug="" +custom_template/release="" +architectures/arm64=true +application/app_store_team_id="" +application/code_sign_identity_debug="" +application/export_method_debug=1 +application/code_sign_identity_release="" +application/export_method_release=0 +application/targeted_device_family=2 +application/bundle_identifier="" +application/signature="" +application/short_version="" +application/version="" +application/icon_interpolation=4 +application/launch_screens_interpolation=4 +application/export_project_only=false +capabilities/access_wifi=false +capabilities/push_notifications=false +user_data/accessible_from_files_app=false +user_data/accessible_from_itunes_sharing=false +privacy/camera_usage_description="" +privacy/camera_usage_description_localized={} +privacy/microphone_usage_description="" +privacy/microphone_usage_description_localized={} +privacy/photolibrary_usage_description="" +privacy/photolibrary_usage_description_localized={} +icons/iphone_120x120="" +icons/iphone_180x180="" +icons/ipad_76x76="" +icons/ipad_152x152="" +icons/ipad_167x167="" +icons/app_store_1024x1024="" +icons/spotlight_40x40="" +icons/spotlight_80x80="" +icons/settings_58x58="" +icons/settings_87x87="" +icons/notification_40x40="" +icons/notification_60x60="" +storyboard/use_launch_screen_storyboard=false +storyboard/image_scale_mode=0 +storyboard/custom_image@2x="" +storyboard/custom_image@3x="" +storyboard/use_custom_bg_color=false +storyboard/custom_bg_color=Color(0, 0, 0, 1) +landscape_launch_screens/iphone_2436x1125="" +landscape_launch_screens/iphone_2208x1242="" +landscape_launch_screens/ipad_1024x768="" +landscape_launch_screens/ipad_2048x1536="" +portrait_launch_screens/iphone_640x960="" +portrait_launch_screens/iphone_640x1136="" +portrait_launch_screens/iphone_750x1334="" +portrait_launch_screens/iphone_1125x2436="" +portrait_launch_screens/ipad_768x1024="" +portrait_launch_screens/ipad_1536x2048="" +portrait_launch_screens/iphone_1242x2208="" + +[preset.4] + +name="Android" +platform="Android" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="build/android/game.apk" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.4.options] + +custom_template/debug="" +custom_template/release="" +gradle_build/use_gradle_build=false +gradle_build/export_format=0 +gradle_build/min_sdk="" +gradle_build/target_sdk="" +architectures/armeabi-v7a=false +architectures/arm64-v8a=true +architectures/x86=false +architectures/x86_64=false +version/code=1 +version/name="" +package/unique_name="com.example.$genname" +package/name="" +package/signed=true +package/app_category=2 +package/retain_data_on_uninstall=false +package/exclude_from_recents=false +package/show_in_android_tv=false +package/show_in_app_library=true +package/show_as_launcher_app=false +launcher_icons/main_192x192="" +launcher_icons/adaptive_foreground_432x432="" +launcher_icons/adaptive_background_432x432="" +graphics/opengl_debug=false +xr_features/xr_mode=0 +screen/immersive_mode=true +screen/support_small=true +screen/support_normal=true +screen/support_large=true +screen/support_xlarge=true +user_data_backup/allow=false +command_line/extra_args="" +apk_expansion/enable=false +apk_expansion/SALT="" +apk_expansion/public_key="" +permissions/custom_permissions=PackedStringArray() +permissions/access_checkin_properties=false +permissions/access_coarse_location=false +permissions/access_fine_location=false +permissions/access_location_extra_commands=false +permissions/access_mock_location=false +permissions/access_network_state=false +permissions/access_surface_flinger=false +permissions/access_wifi_state=false +permissions/account_manager=false +permissions/add_voicemail=false +permissions/authenticate_accounts=false +permissions/battery_stats=false +permissions/bind_accessibility_service=false +permissions/bind_appwidget=false +permissions/bind_device_admin=false +permissions/bind_input_method=false +permissions/bind_nfc_service=false +permissions/bind_notification_listener_service=false +permissions/bind_print_service=false +permissions/bind_remoteviews=false +permissions/bind_text_service=false +permissions/bind_vpn_service=false +permissions/bind_wallpaper=false +permissions/bluetooth=false +permissions/bluetooth_admin=false +permissions/bluetooth_privileged=false +permissions/brick=false +permissions/broadcast_package_removed=false +permissions/broadcast_sms=false +permissions/broadcast_sticky=false +permissions/broadcast_wap_push=false +permissions/call_phone=false +permissions/call_privileged=false +permissions/camera=false +permissions/capture_audio_output=false +permissions/capture_secure_video_output=false +permissions/capture_video_output=false +permissions/change_component_enabled_state=false +permissions/change_configuration=false +permissions/change_network_state=false +permissions/change_wifi_multicast_state=false +permissions/change_wifi_state=false +permissions/clear_app_cache=false +permissions/clear_app_user_data=false +permissions/control_location_updates=false +permissions/delete_cache_files=false +permissions/delete_packages=false +permissions/device_power=false +permissions/diagnostic=false +permissions/disable_keyguard=false +permissions/dump=false +permissions/expand_status_bar=false +permissions/factory_test=false +permissions/flashlight=false +permissions/force_back=false +permissions/get_accounts=false +permissions/get_package_size=false +permissions/get_tasks=false +permissions/get_top_activity_info=false +permissions/global_search=false +permissions/hardware_test=false +permissions/inject_events=false +permissions/install_location_provider=false +permissions/install_packages=false +permissions/install_shortcut=false +permissions/internal_system_window=false +permissions/internet=false +permissions/kill_background_processes=false +permissions/location_hardware=false +permissions/manage_accounts=false +permissions/manage_app_tokens=false +permissions/manage_documents=false +permissions/manage_external_storage=false +permissions/master_clear=false +permissions/media_content_control=false +permissions/modify_audio_settings=false +permissions/modify_phone_state=false +permissions/mount_format_filesystems=false +permissions/mount_unmount_filesystems=false +permissions/nfc=false +permissions/persistent_activity=false +permissions/process_outgoing_calls=false +permissions/read_calendar=false +permissions/read_call_log=false +permissions/read_contacts=false +permissions/read_external_storage=false +permissions/read_frame_buffer=false +permissions/read_history_bookmarks=false +permissions/read_input_state=false +permissions/read_logs=false +permissions/read_phone_state=false +permissions/read_profile=false +permissions/read_sms=false +permissions/read_social_stream=false +permissions/read_sync_settings=false +permissions/read_sync_stats=false +permissions/read_user_dictionary=false +permissions/reboot=false +permissions/receive_boot_completed=false +permissions/receive_mms=false +permissions/receive_sms=false +permissions/receive_wap_push=false +permissions/record_audio=false +permissions/reorder_tasks=false +permissions/restart_packages=false +permissions/send_respond_via_message=false +permissions/send_sms=false +permissions/set_activity_watcher=false +permissions/set_alarm=false +permissions/set_always_finish=false +permissions/set_animation_scale=false +permissions/set_debug_app=false +permissions/set_orientation=false +permissions/set_pointer_speed=false +permissions/set_preferred_applications=false +permissions/set_process_limit=false +permissions/set_time=false +permissions/set_time_zone=false +permissions/set_wallpaper=false +permissions/set_wallpaper_hints=false +permissions/signal_persistent_processes=false +permissions/status_bar=false +permissions/subscribed_feeds_read=false +permissions/subscribed_feeds_write=false +permissions/system_alert_window=false +permissions/transmit_ir=false +permissions/uninstall_shortcut=false +permissions/update_device_stats=false +permissions/use_credentials=false +permissions/use_sip=false +permissions/vibrate=false +permissions/wake_lock=false +permissions/write_apn_settings=false +permissions/write_calendar=false +permissions/write_call_log=false +permissions/write_contacts=false +permissions/write_external_storage=false +permissions/write_gservices=false +permissions/write_history_bookmarks=false +permissions/write_profile=false +permissions/write_secure_settings=false +permissions/write_settings=false +permissions/write_sms=false +permissions/write_social_stream=false +permissions/write_sync_settings=false +permissions/write_user_dictionary=false + +[preset.5] + +name="macOS" +platform="macOS" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="build/mac/game.zip" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.5.options] + +export/distribution_type=1 +binary_format/architecture="universal" +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +application/icon="" +application/icon_interpolation=4 +application/bundle_identifier="" +application/signature="" +application/app_category="Games" +application/short_version="" +application/version="" +application/copyright="" +application/copyright_localized={} +application/min_macos_version="10.12" +application/export_angle=0 +display/high_res=true +xcode/platform_build="14C18" +xcode/sdk_version="13.1" +xcode/sdk_build="22C55" +xcode/sdk_name="macosx13.1" +xcode/xcode_version="1420" +xcode/xcode_build="14C18" +codesign/codesign=1 +codesign/installer_identity="" +codesign/apple_team_id="" +codesign/identity="" +codesign/entitlements/custom_file="" +codesign/entitlements/allow_jit_code_execution=false +codesign/entitlements/allow_unsigned_executable_memory=false +codesign/entitlements/allow_dyld_environment_variables=false +codesign/entitlements/disable_library_validation=false +codesign/entitlements/audio_input=false +codesign/entitlements/camera=false +codesign/entitlements/location=false +codesign/entitlements/address_book=false +codesign/entitlements/calendars=false +codesign/entitlements/photos_library=false +codesign/entitlements/apple_events=false +codesign/entitlements/debugging=false +codesign/entitlements/app_sandbox/enabled=false +codesign/entitlements/app_sandbox/network_server=false +codesign/entitlements/app_sandbox/network_client=false +codesign/entitlements/app_sandbox/device_usb=false +codesign/entitlements/app_sandbox/device_bluetooth=false +codesign/entitlements/app_sandbox/files_downloads=0 +codesign/entitlements/app_sandbox/files_pictures=0 +codesign/entitlements/app_sandbox/files_music=0 +codesign/entitlements/app_sandbox/files_movies=0 +codesign/entitlements/app_sandbox/files_user_selected=0 +codesign/entitlements/app_sandbox/helper_executables=[] +codesign/custom_options=PackedStringArray() +notarization/notarization=0 +privacy/microphone_usage_description="" +privacy/microphone_usage_description_localized={} +privacy/camera_usage_description="" +privacy/camera_usage_description_localized={} +privacy/location_usage_description="" +privacy/location_usage_description_localized={} +privacy/address_book_usage_description="" +privacy/address_book_usage_description_localized={} +privacy/calendar_usage_description="" +privacy/calendar_usage_description_localized={} +privacy/photos_library_usage_description="" +privacy/photos_library_usage_description_localized={} +privacy/desktop_folder_usage_description="" +privacy/desktop_folder_usage_description_localized={} +privacy/documents_folder_usage_description="" +privacy/documents_folder_usage_description_localized={} +privacy/downloads_folder_usage_description="" +privacy/downloads_folder_usage_description_localized={} +privacy/network_volumes_usage_description="" +privacy/network_volumes_usage_description_localized={} +privacy/removable_volumes_usage_description="" +privacy/removable_volumes_usage_description_localized={} +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..b370ceb --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..ce82d29 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bdvx58rwnaeev" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/main.tscn b/main.tscn new file mode 100644 index 0000000..d823b82 --- /dev/null +++ b/main.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=3 uid="uid://brs6u78mwggbp"] + +[ext_resource type="Texture2D" uid="uid://bdvx58rwnaeev" path="res://icon.svg" id="1_xhw8e"] + +[node name="Node2D" type="Node2D"] + +[node name="Icon" type="Sprite2D" parent="."] +position = Vector2(552, 307) +texture = ExtResource("1_xhw8e") diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..87d11a1 --- /dev/null +++ b/project.godot @@ -0,0 +1,16 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="Godot Template" +run/main_scene="res://main.tscn" +config/features=PackedStringArray("4.2", "Forward Plus") +config/icon="res://icon.svg"