Skip to content

Commit

Permalink
Merge build native.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Dec 20, 2024
1 parent 38734d3 commit 6f95695
Showing 1 changed file with 46 additions and 108 deletions.
154 changes: 46 additions & 108 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,93 +8,11 @@ on:
types: [opened, reopened, edited, synchronize]

jobs:
build-native:
runs-on: macos-latest
permissions:
pull-requests: write
actions: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
GODOT_BASE_BRANCH: main
CACHE_NAME: v-sekai-godot

strategy:
fail-fast: false
matrix:
precision: [double]
platform: [macos]
target: [editor, template_release, template_debug]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}
cancel-in-progress: true

steps:
- name: Set up dependencies
run: brew install just hyperfine scons

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.22.3"

- name: Set up placeholders
run: |
mkdir -p godot/bin/
mkdir -p tpz/
mkdir -p editor
echo "This is the README for the Godot bin directory." > godot/bin/readme.md
echo "This is the README for the TPZ directory." > tpz/readme.md
echo "This is the README for the Editor directory." > editor/readme.md
- name: Checkout code
uses: actions/checkout@v4

- name: Cache SCons cache
uses: actions/cache@v4
if: always()
with:
path: |
.scons_cache
key: ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}
restore-keys: |
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-refs/heads/${{ env.GODOT_BASE_BRANCH }}
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}
- name: Fetch dependencies and Build Platform Target
run: |
export PLATFORM_ARGS="fetch-vulkan-sdk"
hyperfine --show-output --runs 1 'just $PLATFORM_ARGS && just build-platform-target ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.precision }}'
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}
path: godot/bin/*

- name: Upload TPZ File
uses: actions/upload-artifact@v4
with:
name: Godot-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}.tpz
path: tpz

- name: Upload Godot Editor Files
uses: actions/upload-artifact@v4
with:
name: Godot-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}
path: editor
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
permissions:
pull-requests: write
actions: write
container:
image: fedora:39
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
Expand All @@ -104,23 +22,41 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
precision: [double]
platform: [linuxbsd, windows, android, web]
platform: [macos, linuxbsd, windows, android, web]
target: [editor, template_release, template_debug]
include:
- os: macos-latest
platform: macos
- os: ubuntu-latest
platform: linuxbsd
- os: ubuntu-latest
platform: windows
- os: ubuntu-latest
platform: android
- os: ubuntu-latest
platform: web

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}
cancel-in-progress: true

steps:
- name: Set up dependencies
run: dnf install -y just git
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
brew install just hyperfine scons
else
apt-get update
apt-get install -y just git
fi
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.22.3"

- name: Set up placeholders
run: |
mkdir -p godot/bin/
Expand All @@ -135,7 +71,6 @@ jobs:

- name: Cache SCons cache
uses: actions/cache@v4
# Skip cache on Linux, PR #12
if: ${{ matrix.platform != 'linuxbsd' }}
with:
path: |
Expand All @@ -148,7 +83,6 @@ jobs:
mingw
key: ${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}
restore-keys: |
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.precision }}
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.target }}
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}-${{ github.sha }}
${{ env.CACHE_NAME }}-${{ env.GODOT_BASE_BRANCH }}-${{ github.ref }}
Expand All @@ -157,25 +91,29 @@ jobs:
- name: Fetch dependencies and Build Platform Target
run: |
just install_packages
export PLATFORM_ARGS=""
case "${{ matrix.platform }}" in
android)
PLATFORM_ARGS="fetch-openjdk setup-android-sdk"
;;
web)
PLATFORM_ARGS="setup-emscripten"
;;
windows)
PLATFORM_ARGS="fetch-llvm-mingw"
;;
macos)
PLATFORM_ARGS="build-osxcross fetch-vulkan-sdk"
;;
*)
PLATFORM_ARGS="nil"
;;
esac
if [ "${{ matrix.os }}" == "macos-latest" ]; then
export PLATFORM_ARGS="fetch-vulkan-sdk"
else
just install_packages
export PLATFORM_ARGS=""
case "${{ matrix.platform }}" in
android)
PLATFORM_ARGS="fetch-openjdk setup-android-sdk"
;;
web)
PLATFORM_ARGS="setup-emscripten"
;;
windows)
PLATFORM_ARGS="fetch-llvm-mingw"
;;
macos)
PLATFORM_ARGS="build-osxcross fetch-vulkan-sdk"
;;
*)
PLATFORM_ARGS="nil"
;;
esac
fi
hyperfine --show-output --runs 1 'just $PLATFORM_ARGS && just build-platform-target ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.precision }}'
- name: Upload Artifacts
Expand All @@ -198,7 +136,7 @@ jobs:

merge-templates:
runs-on: ubuntu-latest
needs: ["build", "build-native"]
needs: build
steps:
- name: Merge Export Templates
uses: actions/upload-artifact/merge@v4
Expand Down

0 comments on commit 6f95695

Please sign in to comment.