From 0fcc60272f67e446ad93ee1df73b7133a7908463 Mon Sep 17 00:00:00 2001 From: florianvazelle Date: Sat, 13 Jan 2024 13:28:12 +0100 Subject: [PATCH] ci: use macos runner --- .github/workflows/release-packaging.yml | 8 ++--- Justfile | 42 +++++++++++++++---------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release-packaging.yml b/.github/workflows/release-packaging.yml index a44eb69..84e5cf9 100644 --- a/.github/workflows/release-packaging.yml +++ b/.github/workflows/release-packaging.yml @@ -36,8 +36,8 @@ jobs: [ "${{ env.game_version }}" == "${{ env.BRANCH_NAME }}" ] || exit 2 build: - runs-on: ubuntu-22.04 - timeout-minutes: 30 + runs-on: macos-12 + timeout-minutes: 10 needs: [check] steps: @@ -69,8 +69,8 @@ jobs: retention-days: 1 deploy: - runs-on: ubuntu-22.04 - timeout-minutes: 30 + runs-on: macos-12 + timeout-minutes: 3 needs: [check] if: github.ref == 'refs/heads/main' diff --git a/Justfile b/Justfile index 2c05b36..292c9b7 100644 --- a/Justfile +++ b/Justfile @@ -29,26 +29,29 @@ dist_dir := justfile_directory() / "dist" # Godot variables godot_version := env_var('GODOT_VERSION') -godot_platform := if arch() == "x86" { - "linux.x86_32" +godot_platform := if os() == "windows" { + if arch() == "x86" { + "win32.exe" + } else if arch() == "x86_64" { + "win64.exe" + } else { "" } +} else if os() == "macos" { + "macos.universal" } else { - if arch() == "x86_64" { - "linux.x86_64" - } else { - if arch() == "arm" { - "linux.arm32" - } else { - if arch() == "aarch64" { + if arch() == "x86" { + "linux.x86_32" + } else if arch() == "x86_64" { + "linux.x86_64" + } else if arch() == "arm" { + "linux.arm32" + } else if arch() == "aarch64" { "linux.arm64" - } else { "" } - } - } + } else { "" } } godot_filename := "Godot_v" + godot_version + "-stable_" + godot_platform godot_template := "Godot_v" + godot_version + "-stable_export_templates.tpz" godot_bin := bin_dir / godot_filename godot_editor_data_dir := "~/.local/share/godot/" -use_x11_wrapper := if godot_platform =~ "x11*" { env("CI", "false") } else { "false" } # Game variables game_name := env_var('GAME_NAME') @@ -86,6 +89,11 @@ butler_platform := if arch() == "x86" { "linux-386" } else { if arch() == "x86_6 [ ! -d {{ venv_dir }} ] && python3 -m venv {{ venv_dir }} || true . {{ venv_dir }}/bin/activate && {{ ARGS }} +# sed command that works on Linux and MacOs +[private] +@sed script file: + sed -i.bak -e {{ script }} -- "{{ file }}" && rm -- "{{ file }}.bak" + # Download Godot [private] install-godot: @@ -120,10 +128,10 @@ import-resources: # Updates the game version for export @bump-version: echo "Update version in the presets.cfg" - sed -i "s,application/file_version=.*$,application/file_version=\"{{ game_version }}.{{ datetime }}\",g" ./export_presets.cfg - sed -i "s,application/product_version=.*$,application/product_version=\"{{ game_version }}.{{ datetime }}\",g" ./export_presets.cfg - sed -i "s,application/version=.*$,application/version=\"{{ game_version }}\",g" ./export_presets.cfg - sed -i "s,application/short_version=.*$,application/short_version=\"{{ short_version }}\",g" ./export_presets.cfg + just sed "s,application/file_version=.*$,application/file_version=\"{{ game_version }}.{{ datetime }}\",g" export_presets.cfg + just sed "s,application/product_version=.*$,application/product_version=\"{{ game_version }}.{{ datetime }}\",g" export_presets.cfg + just sed "s,application/version=.*$,application/version=\"{{ game_version }}\",g" export_presets.cfg + just sed "s,application/short_version=.*$,application/short_version=\"{{ short_version }}\",g" export_presets.cfg echo "Create the override.cfg" touch override.cfg