Skip to content

Commit

Permalink
Merge pull request #25 from ImGuiNET/f/more-parallel
Browse files Browse the repository at this point in the history
removing serial build
  • Loading branch information
zaafar authored Sep 21, 2023
2 parents af791ca + 44c4d08 commit c279741
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 57 deletions.
87 changes: 34 additions & 53 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,102 +24,83 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
include:
- os: macos-latest
- os: ubuntu-latest
- os: windows-latest
architecture: x64
- os: windows-latest
architecture: x86
- os: windows-latest
architecture: ARM64
- os: windows-latest
architecture: ARM

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get Submodules
run: git submodule update --init --recursive
submodules: recursive

- name: Setup .NET
if: matrix.os == 'windows-latest'
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Build source package
if: matrix.os == 'windows-latest'
if: matrix.os == 'windows-latest' && matrix.architecture == 'x64'
run: dotnet pack -c Release ImGui.NET.SourceBuild.csproj
shell: bash

- name: Upload source package
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
if: matrix.os == 'windows-latest' && matrix.architecture == 'x64'
with:
name: win-x64
path: bin\Packages\Release\*.nupkg

- name: Publish untagged source package to MyGet
if: matrix.os == 'windows-latest' && github.ref == 'refs/heads/master'
if: matrix.os == 'windows-latest' && github.ref == 'refs/heads/master' && matrix.architecture == 'x64'
run: dotnet nuget push bin\Packages\Release\*.nupkg -s https://www.myget.org/F/mellinoe/api/v3/index.json --api-key ${{secrets.MYGET_KEY}}

- name: Publish tagged source package release to nuget.org
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/')
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/') && matrix.architecture == 'x64'
run: dotnet nuget push bin\Packages\Release\*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_KEY}}

- name: Build ${{ github.event.inputs.ReleaseType || 'Release' }}
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
./ci-build.cmd ${{ github.event.inputs.ReleaseType || 'Release' }}
./ci-build.cmd ${{ github.event.inputs.ReleaseType || 'Release' }} ${{ matrix.architecture }}
else
./ci-build.sh ${{ github.event.inputs.ReleaseType || 'Release' }}
fi
shell: bash

- name: Upload win-x64 ${{ github.event.inputs.ReleaseType || 'Release' }}
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: win-x64
path: cimgui\build\x64\${{ github.event.inputs.ReleaseType || 'Release' }}\*

- name: Upload win-x86 ${{ github.event.inputs.ReleaseType || 'Release' }}
- name: Upload win-${{ matrix.architecture }} ${{ github.event.inputs.ReleaseType || 'Release' }}
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: win-x86
path: cimgui\build\x86\${{ github.event.inputs.ReleaseType || 'Release' }}\*
name: win-${{ matrix.architecture }}
path: cimgui\build\${{ matrix.architecture }}\${{ github.event.inputs.ReleaseType || 'Release' }}\*

- name: Upload win-arm ${{ github.event.inputs.ReleaseType || 'Release' }}
- name: Upload ${{ matrix.os }} ${{ github.event.inputs.ReleaseType || 'Release' }}
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
with:
name: win-arm
path: cimgui\build\ARM\${{ github.event.inputs.ReleaseType || 'Release' }}\*

- name: Upload win-arm64 ${{ github.event.inputs.ReleaseType || 'Release' }}
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
with:
name: win-arm64
path: cimgui\build\ARM64\${{ github.event.inputs.ReleaseType || 'Release' }}\*

- name: Upload Linux ${{ github.event.inputs.ReleaseType || 'Release' }}
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: linux-x64
path: cimgui/build/${{ github.event.inputs.ReleaseType || 'Release' }}/*

- name: Upload MacOS ${{ github.event.inputs.ReleaseType || 'Release' }}
uses: actions/upload-artifact@v3
if: matrix.os == 'macos-latest'
with:
name: osx-x64
name: ${{ matrix.os }}-x64
path: cimgui/build/${{ github.event.inputs.ReleaseType || 'Release' }}/*

- name: Upload Definitions Json File
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
if: matrix.os == 'windows-latest' && matrix.architecture == 'x64'
with:
name: JsonFiles
path: cimgui\generator\output\definitions.json

- name: Upload structs_and_enums Json File
uses: actions/upload-artifact@v3
if: matrix.os == 'windows-latest'
if: matrix.os == 'windows-latest' && matrix.architecture == 'x64'
with:
name: JsonFiles
path: cimgui\generator\output\structs_and_enums.json
Expand All @@ -136,17 +117,17 @@ jobs:
run: |
mv win-x64/cimgui.dll win-x64/cimgui.win-x64.dll
mv win-x86/cimgui.dll win-x86/cimgui.win-x86.dll
mv win-arm64/cimgui.dll win-arm64/cimgui.win-arm64.dll
mv win-arm/cimgui.dll win-arm/cimgui.win-arm.dll
mv win-ARM64/cimgui.dll win-arm64/cimgui.win-arm64.dll
mv win-ARM/cimgui.dll win-arm/cimgui.win-arm.dll
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
win-x64/cimgui.win-x64.dll
win-x86/cimgui.win-x86.dll
win-arm64/cimgui.win-arm64.dll
win-arm/cimgui.win-arm.dll
win-ARM64/cimgui.win-arm64.dll
win-ARM/cimgui.win-arm.dll
JsonFiles/*
linux-x64/cimgui.so
osx-x64/cimgui.dylib
ubuntu-latest-x64/cimgui.so
macos-latest-x64/cimgui.dylib
6 changes: 2 additions & 4 deletions ci-build.cmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@setlocal
@echo off
set "RTYPE=%1"
set "RARCH=%2"

call %~dp0build-native.cmd %RTYPE% x64
call %~dp0build-native.cmd %RTYPE% x86
call %~dp0build-native.cmd %RTYPE% ARM64
call %~dp0build-native.cmd %RTYPE% ARM
call %~dp0build-native.cmd %RTYPE% %RARCH%

0 comments on commit c279741

Please sign in to comment.