Skip to content

Commit

Permalink
Try to fix Windows workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MewPurPur committed Jun 3, 2024
1 parent f2e949f commit bae84cf
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 53 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/dev-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ on:
pull_request:
branches: [ main ]


env:
GODOT_VERSION: 4.2.2
GODOT_RELEASE: rc3
PROJECT_NAME: GodSVG


jobs:
export-windows:
name: Export GodSVG for Windows
Expand All @@ -29,9 +26,10 @@ jobs:
uses: ./.github/actions/set-up-godot
- name: Set up WINE and rcedit for Windows export
run: |
# Download rcedit and intall wine.
# Download rcedit and install wine.
wget -q https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
sudo apt install wine64
sudo apt-get update
sudo apt-get install -y --fix-missing wine64
# Move rcedit to different place.
mkdir -v -p ~/.local/share/rcedit
mv rcedit-x64.exe ~/.local/share/rcedit
Expand Down
109 changes: 61 additions & 48 deletions .github/workflows/export-optimized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Check user
run: |
if [[ "${{ github.actor }}" != "MewPurPur" ]]; then
if [ "${{ github.actor }}" != "MewPurPur" ]; then
echo "Unauthorized user: ${{ github.actor }}"
exit 1
fi
Expand Down Expand Up @@ -51,6 +51,7 @@ jobs:
with:
name: godot_template_linux
path: $BUILD_DIR/godot_template_linux
retention-days: 1

build-windows:
runs-on: windows-latest
Expand All @@ -60,10 +61,10 @@ jobs:

- name: Check user
run: |
if [[ "${{ github.actor }}" != "MewPurPur" ]]; then
echo "Unauthorized user: ${{ github.actor }}"
if ($env:GITHUB_ACTOR -ne "MewPurPur") {
Write-Host "Unauthorized user: $env:GITHUB_ACTOR"
exit 1
fi
}
- name: Install dependencies
run: choco install scons
Expand All @@ -90,41 +91,52 @@ jobs:
path: $BUILD_DIR/godot_template_windows

build-web:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check user
run: |
if [[ "${{ github.actor }}" != "MewPurPur" ]]; then
echo "Unauthorized user: ${{ github.actor }}"
exit 1
fi
- name: Install dependencies
run: sudo apt-get install -y scons python3

- name: Clone Godot repository
run: git clone $GODOT_REPO $GODOT_DIR

- name: Checkout specific commit
run: |
cd $GODOT_DIR
git fetch
git checkout $GODOT_COMMIT_HASH
- name: Build Godot template for Web
run: |
cd $GODOT_DIR
scons p=web arch=wasm32 javascript_eval=no target=template_release lto=full production=yes dev_build=no optimize=size $BUILD_OPTIONS
cp bin/godot.web.*.template_release.wasm ../$BUILD_DIR/godot_template_web
- name: Upload Web template
uses: actions/upload-artifact@v3
with:
name: godot_template_web
path: $BUILD_DIR/godot_template_web
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check user
run: |
if [ "${{ github.actor }}" != "MewPurPur" ]; then
echo "Unauthorized user: ${{ github.actor }}"
exit 1
fi
- name: Install dependencies
run: sudo apt-get install -y scons python3

- name: Install Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
shell: bash

- name: Clone Godot repository
run: git clone $GODOT_REPO $GODOT_DIR

- name: Checkout specific commit
run: |
cd $GODOT_DIR
git fetch
git checkout $GODOT_COMMIT_HASH
- name: Build Godot template for Web
run: |
cd $GODOT_DIR
source ../emsdk/emsdk_env.sh
scons platform=javascript target=release_debug $BUILD_OPTIONS
mkdir -p ../$BUILD_DIR/godot_template_web
cp bin/godot.javascript.opt.* ../$BUILD_DIR/godot_template_web
- name: Upload Web template
uses: actions/upload-artifact@v3
with:
name: godot_template_web
path: $BUILD_DIR/godot_template_web

build-macos:
runs-on: macos-latest
Expand All @@ -134,7 +146,7 @@ jobs:

- name: Check user
run: |
if [[ "${{ github.actor }}" != "MewPurPur" ]]; then
if [ "${{ github.actor }}" != "MewPurPur" ]; then
echo "Unauthorized user: ${{ github.actor }}"
exit 1
fi
Expand All @@ -154,26 +166,26 @@ jobs:
- name: Build Godot template for macOS (arm64 release)
run: |
cd $GODOT_DIR
scons p=osx arch=arm64 target=template_release optimize=speed $BUILD_OPTIONS
cp bin/godot.osx.template_release.arm64 ../$BUILD_DIR/godot_template_macos_release_arm64
scons p=macos arch=arm64 target=template_release optimize=speed $BUILD_OPTIONS
cp bin/godot.macos.template_release.arm64 ../$BUILD_DIR/godot_template_macos_release_arm64
- name: Build Godot template for macOS (x86_64 release)
run: |
cd $GODOT_DIR
scons p=osx arch=x86_64 target=template_release optimize=speed $BUILD_OPTIONS
cp bin/godot.osx.template_release.x86_64 ../$BUILD_DIR/godot_template_macos_release_x86_64
scons p=macos arch=x86_64 target=template_release optimize=speed $BUILD_OPTIONS
cp bin/godot.macos.template_release.x86_64 ../$BUILD_DIR/godot_template_macos_release_x86_64
- name: Build Godot template for macOS (arm64 debug)
run: |
cd $GODOT_DIR
scons p=osx arch=arm64 target=template_debug optimize=speed $BUILD_OPTIONS
cp bin/godot.osx.template_debug.arm64 ../$BUILD_DIR/godot_template_macos_debug_arm64
scons p=macos arch=arm64 target=template_debug optimize=speed $BUILD_OPTIONS
cp bin/godot.macos.template_debug.arm64 ../$BUILD_DIR/godot_template_macos_debug_arm64
- name: Build Godot template for macOS (x86_64 debug)
run: |
cd $GODOT_DIR
scons p=osx arch=x86_64 target=template_debug optimize=speed $BUILD_OPTIONS
cp bin/godot.osx.template_debug.x86_64 ../$BUILD_DIR/godot_template_macos_debug_x86_64
scons p=macos arch=x86_64 target=template_debug optimize=speed $BUILD_OPTIONS
cp bin/godot.macos.template_debug.x86_64 ../$BUILD_DIR/godot_template_macos_debug_x86_64
- name: Combine binaries with lipo
run: |
Expand All @@ -198,3 +210,4 @@ jobs:
with:
name: godot_template_macos
path: macos.zip

0 comments on commit bae84cf

Please sign in to comment.