generated from nathanfranke/gdextension
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab34184
commit d2c5095
Showing
7 changed files
with
213 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Setup build cache | ||
description: Setup build cache. | ||
inputs: | ||
cache-name: | ||
description: The cache base name (job name by default). | ||
default: "${{github.job}}" | ||
scons-cache: | ||
description: The scons cache path. | ||
default: "${{github.workspace}}/.scons-cache/" | ||
runs: | ||
using: "composite" | ||
steps: | ||
# Upload cache on completion and check it out now | ||
- name: Load .scons_cache directory | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{inputs.scons-cache}} | ||
key: ${{inputs.cache-name}}-main-${{github.ref}}-${{github.sha}} | ||
|
||
# We try to match an existing cache to restore from it. Each potential key is checked against | ||
# all existing caches as a prefix. E.g. 'linux-template-minimal' would match any cache that | ||
# starts with "linux-template-minimal", such as "linux-template-minimal-master-refs/heads/master-6588a4a29af1621086feac0117d5d4d37af957fd". | ||
# | ||
# We check these prefixes in this order: | ||
# | ||
# 1. The exact match, including the base branch, the commit reference, and the SHA hash of the commit. | ||
# 2. A partial match for the same base branch and the same commit reference. | ||
# 3. A partial match for the same base branch and the base branch commit reference. | ||
# 4. A partial match for the same base branch only (not ideal, matches any PR with the same base branch). | ||
|
||
restore-keys: | | ||
${{inputs.cache-name}}-main-${{github.ref}}-${{github.sha}} | ||
${{inputs.cache-name}}-main-${{github.ref}} | ||
${{inputs.cache-name}}-main-refs/heads/main | ||
${{inputs.cache-name}}-main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: 🤖 Android Builds | ||
on: [ workflow_call, workflow_dispatch ] | ||
|
||
env: | ||
SCONSFLAGS: verbose=yes | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.runner }} | ||
name: ${{ matrix.name }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- identifier: android-debug | ||
name: Android Debug | ||
runner: ubuntu-20.04 | ||
target: template_debug | ||
platform: android | ||
arch: arm64 | ||
- identifier: android-release | ||
name: Android Release | ||
runner: ubuntu-20.04 | ||
target: template_release | ||
platform: android | ||
arch: arm64 | ||
|
||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: (Android) Set up Android dependencies | ||
if: ${{ startsWith(matrix.identifier, 'android-') }} | ||
uses: ./.github/actions/android-deps | ||
|
||
- name: Setup python & scons | ||
uses: ./.github/actions/base-deps | ||
|
||
- name: Compile extension | ||
shell: sh | ||
env: | ||
SCONS_CACHE: "${{ github.workspace }}/.scons-cache/" | ||
SCONS_CACHE_LIMIT: 7168 | ||
run: | | ||
scons target='${{ matrix.target }}' platform='${{ matrix.platform }}' arch='${{ matrix.arch }}' ${{ env.SCONSFLAGS }} -j2 | ||
ls -l project/addons/terrain_3d/bin/ | ||
- name: Prepare artifact | ||
shell: sh | ||
run: | | ||
strip project/addons/terrain_3d/bin/libterrain.* | ||
ls -l project/addons/terrain_3d/bin/ | ||
cp --no-clobber '${{ github.workspace }}/README.md' '${{ github.workspace }}/LICENSE' ${{ github.workspace }}/project/addons/terrain_3d/ | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
path: | | ||
${{ github.workspace }}/project/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: 🪟 Build (Windows) | ||
on: workflow_dispatch | ||
|
||
env: | ||
SCONSFLAGS: verbose=yes | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.runner }} | ||
name: ${{ matrix.name }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- identifier: windows-debug | ||
name: Windows Debug | ||
runner: ubuntu-20.04 | ||
target: template_debug | ||
platform: windows | ||
arch: x86_64 | ||
- identifier: windows-release | ||
name: Windows Release | ||
runner: ubuntu-20.04 | ||
target: template_release | ||
platform: windows | ||
arch: x86_64 | ||
|
||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: (Windows) Install mingw64 | ||
if: ${{ startsWith(matrix.identifier, 'windows-') }} | ||
shell: sh | ||
run: | | ||
sudo apt-get install mingw-w64 | ||
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix | ||
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix | ||
- name: Setup python & scons | ||
uses: ./.github/actions/base-deps | ||
|
||
- name: Compile extension | ||
shell: sh | ||
env: | ||
SCONS_CACHE: "${{ github.workspace }}/.scons-cache/" | ||
SCONS_CACHE_LIMIT: 7168 | ||
run: | | ||
scons target='${{ matrix.target }}' platform='${{ matrix.platform }}' arch='${{ matrix.arch }}' ${{ env.SCONSFLAGS }} -j2 | ||
ls -l project/addons/terrain_3d/bin/ | ||
- name: Prepare artifact | ||
shell: sh | ||
run: | | ||
strip project/addons/terrain_3d/bin/libterrain.* | ||
ls -l project/addons/terrain_3d/bin/ | ||
cp --no-clobber '${{ github.workspace }}/README.md' '${{ github.workspace }}/LICENSE' ${{ github.workspace }}/project/addons/terrain_3d/ | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
path: | | ||
${{ github.workspace }}/project/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters