Skip to content

Commit

Permalink
Update CI modified by IA
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed Dec 5, 2024
1 parent 8cafbec commit 15d86f1
Showing 1 changed file with 80 additions and 84 deletions.
164 changes: 80 additions & 84 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: CI for GDCEF Godot 4.x
on:
workflow_dispatch:
branches:
- godot-4.x
push:
branches:
- godot-4.x
Expand All @@ -13,113 +11,111 @@ on:
- godot-4.x

jobs:
build:
strategy:
matrix:
include:
- os: macos-14
name: MacOS
os_name: macos
check_files: cef_artifacts/libgdcef.dylib

- os: ubuntu-20.04
name: Linux
os_name: linux
check_files: cef_artifacts/gdCefRenderProcess cef_artifacts/libgdcef.so cef_artifacts/libcef.so
packages: sudo apt-get update

- os: windows-2022
name: Windows
os_name: windows
check_files: \a\gdcef\gdcef\cef_artifacts\gdCefRenderProcess.exe \a\gdcef\gdcef\cef_artifacts\libgdcef.dll \a\gdcef\gdcef\cef_artifacts\libcef.dll
shell: powershell

#############################################################################
### MacOS
#############################################################################
build_macos:
name: Build on MacOS
runs-on: macos-14
name: Build on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Setup MSVC (Windows only)
if: matrix.os == 'windows-2022'
uses: ilammy/msvc-dev-cmd@v1.10.0

- name: Checkout GDCEF
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: godot-4.x
submodules: true

- name: Get version
id: version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT

- name: Install system packages
shell: bash
run: |
brew install ninja
- name: Install python packages
if [[ "${{ matrix.packages }}" != "" ]]; then
${{ matrix.packages }}
fi
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
brew install ninja
fi
cd addons/gdcef
python3 -m pip install -r requirements.txt
- name: Install python packages (MacOS only)
if: matrix.os == 'macos-14'
uses: getsentry/action-setup-venv@v2.1.0
id: venv
with:
python-version: 3.10.7
cache-dependency-path: addons/gdcef/requirements.txt
install-cmd: pip install -r addons/gdcef/requirements.txt
- name: Compile GDCEF
run: |
cd addons/gdcef
python3 build.py
- name: Check build
run: |
ls cef_artifacts/libgdcef.dylib
tar -czvf gdcef-artifacts-godot_4-macos_x86_64.tar.gz cef_artifacts
- name: Do release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
artifacts: "gdcef-artifacts-godot_4-macos_x86_64.tar.gz"

#############################################################################
### Linux
#############################################################################
build_linux:
name: Build on Linux
runs-on: ubuntu-20.04
needs: build_macos
steps:
- name: Checkout GDCEF
uses: actions/checkout@v3
with:
ref: godot-4.x
submodules: true
- name: Install system packages
run: |
sudo apt-get update
cd addons/gdcef
python3 -m pip install -r requirements.txt
- name: Compile GDCEF
shell: bash
run: |
cd addons/gdcef
python3 build.py
- name: Check build
run: |
ls cef_artifacts/gdCefRenderProcess cef_artifacts/libgdcef.so cef_artifacts/libcef.so
tar -czvf gdcef-artifacts-godot_4-linux_x86_64.tar.gz cef_artifacts
- name: Do release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
artifacts: "gdcef-artifacts-godot_4-linux_x86_64.tar.gz"
#############################################################################
### Windows
#############################################################################
build_windows:
name: Build on Windows
runs-on: windows-2022
needs: build_linux
steps:
# Add path for finding cl.exe
# FIXME: I dunno why Godot editor and godot-cpp can find cl.exe while our
# godot native modules cannot find it without this extra path
- uses: ilammy/msvc-dev-cmd@v1.10.0
- name: Set archive name
id: archive
shell: bash
run: echo "tarball_name=gdcef-artifacts-${{ steps.version.outputs.version }}-godot_4-${{ matrix.os_name }}_${{ runner.arch }}.tar.gz" >> $GITHUB_OUTPUT

- name: Checkout GDCEF
uses: actions/checkout@v4
with:
submodules: true
- name: Install system packages
shell: powershell
- name: Check build (Linux/MacOS)
if: runner.os != 'Windows'
shell: bash
run: |
cd addons/gdcef
python3 -m pip install -r requirements.txt
- name: Compile GDCEF
ls ${{ matrix.check_files }}
tar -czvf ${{ steps.archive.outputs.tarball_name }} cef_artifacts
- name: Check build (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
cd addons/gdcef
python3 build.py
- name: Check build
run: |
cd cef_artifacts
Test-Path -Path \a\gdcef\gdcef\cef_artifacts\gdCefRenderProcess.exe
Test-Path -Path \a\gdcef\gdcef\cef_artifacts\libgdcef.dll
Test-Path -Path \a\gdcef\gdcef\cef_artifacts\libcef.dll
cd -
tar -czvf gdcef-artifacts-godot_4-windows_x86_64.tar.gz cef_artifacts
- name: Do release
foreach ($file in "${{ matrix.check_files }}".Split(" ")) {
if (!(Test-Path -Path $file)) { exit 1 }
}
cd ..
tar -czvf ${{ steps.archive.outputs.tarball_name }} cef_artifacts
- name: Upload artifact
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: ${{ steps.archive.outputs.tarball_name }}
path: ${{ steps.archive.outputs.tarball_name }}

release:
needs: build
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4

- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "gdcef-artifacts-godot_4-windows_x86_64.tar.gz"
artifacts: "**/*.tar.gz"
allowUpdates: true
makeLatest: true

0 comments on commit 15d86f1

Please sign in to comment.