-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
2 changed files
with
150 additions
and
0 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,113 @@ | ||
name: Build | ||
on: | ||
- workflow_dispatch | ||
- workflow_call | ||
|
||
jobs: | ||
compile-for-windows: | ||
name: Compile for Windows | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Compile Native Components | ||
shell: C:\msys64\usr\bin\bash.exe -e '{0}' | ||
run: | | ||
cd NativeComponents/ | ||
make | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: native-windows | ||
path: | | ||
NativeComponents/ImGuizmo-Bridge.dll | ||
NativeComponents/ImGuizmo-Bridge.LICENSE.txt | ||
compile-for-linux: | ||
name: Compile for Linux | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Compile Native Components | ||
run: | | ||
cd NativeComponents/ | ||
make | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: native-linux | ||
path: | | ||
NativeComponents/libImGuizmo-Bridge.so | ||
NativeComponents/ImGuizmo-Bridge.LICENSE.txt | ||
compile-net-wrapper: | ||
name: Compile .NET wrapper | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: false # Don't need submodules here | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: Build .NET Library | ||
run: | | ||
cd ImGuizmo.NET | ||
dotnet build -c Release --nologo -o ../bin/Release | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dotnet | ||
path: | | ||
bin/Release/ | ||
package-results: | ||
name: Package Workflow Results | ||
runs-on: ubuntu-latest | ||
needs: | ||
- compile-for-windows | ||
- compile-for-linux | ||
- compile-net-wrapper | ||
steps: | ||
- name: Pull Windows Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: native-windows | ||
path: windows | ||
- name: Pull Linux Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: native-linux | ||
path: linux | ||
- name: Pull .NET Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dotnet | ||
path: dotnet | ||
- name: Verify LICENSE Consistency | ||
run: | | ||
set +e | ||
difference="$(diff --strip-trailing-cr -u windows/ImGuizmo-Bridge.LICENSE.txt linux/ImGuizmo-Bridge.LICENSE.txt)" | ||
if [[ "$?" -ne 0 ]]; then | ||
printf "Detected discrepancy in LICENSE files, aborting!\n\nDiff:\n%s\n" "$difference" >&2 | ||
exit 1 | ||
fi | ||
- name: Package Results | ||
run: | | ||
mkdir package | ||
mv windows/ImGuizmo-Bridge.dll package/ | ||
mv linux/libImGuizmo-Bridge.so package/ | ||
mv linux/ImGuizmo-Bridge.LICENSE.txt package/ | ||
mv dotnet/* package/ | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: imguizmo | ||
path: package/* |
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,37 @@ | ||
name: Create Release | ||
|
||
# Only allow one of these at a time (in case of tag deletion) | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
tags: [ 'v*' ] | ||
|
||
jobs: | ||
build-release: | ||
name: Build Release | ||
uses: ./.github/workflows/build.yml | ||
upload-release: | ||
name: Upload Release | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
needs: build-release | ||
steps: | ||
- name: Download Package Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: imguizmo | ||
path: package/ | ||
- name: Create Release Zip | ||
run: | | ||
cd package/ | ||
7z a ../ImGuizmo.NET.zip . | ||
- name: Upload Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
prerelease: false | ||
fail_on_unmatched_files: true | ||
files: ImGuizmo.NET.zip |