Skip to content

Commit

Permalink
Add CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Fayti1703 committed Feb 21, 2023
2 parents 4e485f5 + 6fbd539 commit eb67e27
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 0 deletions.
113 changes: 113 additions & 0 deletions .github/workflows/build.yml
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/*
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit eb67e27

Please sign in to comment.