From 6a53822a334608424ce7d5cf459b1b1635dd08a1 Mon Sep 17 00:00:00 2001 From: alnikulin Date: Tue, 7 Jan 2025 01:03:51 +0200 Subject: [PATCH] Feature/cicd (#6) --- .github/workflows/github-actions.yml | 41 +++++++++++++++++++++++++++ .github/workflows/scripts/prebuild.sh | 22 ++++++++++++++ body.md | 5 ++++ 3 files changed, 68 insertions(+) create mode 100644 .github/workflows/github-actions.yml create mode 100644 .github/workflows/scripts/prebuild.sh create mode 100644 body.md diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 0000000..af582e6 --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -0,0 +1,41 @@ +name: Astrolaser builf and release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Build project + run: | + sudo bash .github/workflows/scripts/prebuild.sh + /usr/local/bin/godot --headless --path . --export-release "Windows Desktop" game.exe + zip astrolaser_x64_windows.zip game.exe game.pck + + - name: Upload build artifact windows + uses: actions/upload-artifact@v3 + with: + name: astrolaser-artifact-win + path: astrolaser_x64_windows.zip + + release: + runs-on: ubuntu-latest + needs: build + steps: + - name: Download build artifact win + uses: actions/download-artifact@v3 + with: + name: astrolaser-artifact-win + path: ./ + + - name: Create Release and Upload Assets + uses: ncipollo/release-action@v1 + with: + artifacts: "astrolaser_x64_windows.zip,labyrintum_x64_linux.zip" + bodyFile: "body.md" diff --git a/.github/workflows/scripts/prebuild.sh b/.github/workflows/scripts/prebuild.sh new file mode 100644 index 0000000..3098248 --- /dev/null +++ b/.github/workflows/scripts/prebuild.sh @@ -0,0 +1,22 @@ +#!/bin/bash -x + +set -e + +GODOT_VERSION="Godot_v4.2-stable_linux.x86_64" + +wget https://github.com/godotengine/godot-builds/releases/download/4.2-stable/${GODOT_VERSION}.zip + +sudo apt update \ + && apt install -y libfontconfig unzip \ + && unzip ${GODOT_VERSION} + +sudo mv ${GODOT_VERSION} /usr/local/bin/godot +sudo chmod +x /usr/local/bin/godot && godot --version + +# Install godot templates +wget https://github.com/godotengine/godot-builds/releases/download/4.2-stable/Godot_v4.2-stable_export_templates.tpz +unzip Godot_v4.2-stable_export_templates.tpz +sudo mkdir -p ~/.local/share/godot/export_templates/4.2.stable/ +sudo mkdir -p /home/runner/.local/share/godot/export_templates/4.2.stable/ +sudo cp -rv templates/* ~/.local/share/godot/export_templates/4.2.stable/ +sudo cp -rv templates/* /home/runner/.local/share/godot/export_templates/4.2.stable/ diff --git a/body.md b/body.md new file mode 100644 index 0000000..68a215c --- /dev/null +++ b/body.md @@ -0,0 +1,5 @@ +# Astrolaser - Release Notes + +## Version: v0.0.1 + +### First game release