Skip to content

Commit

Permalink
ci: use macos runner
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Jan 13, 2024
1 parent c85610c commit 0fcc602
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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'
Expand Down
42 changes: 25 additions & 17 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0fcc602

Please sign in to comment.