Skip to content

Path deformation revise for MeshGroup (#313) #18

Path deformation revise for MeshGroup (#313)

Path deformation revise for MeshGroup (#313) #18

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Build & Release
on:
push:
# Push all normally versioned tags
# Ignore release candidates!
tags:
- '*'
- '!*-rc*'
permissions:
contents: write
jobs:
build-resources:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: 'Install dependencies'
run: |
sudo apt-get update
sudo apt-get install gettext
mkdir out/
- name: 'Generate i18n'
run: |
# Build translations
mkdir otl/
sudo chmod +x ./gentl.sh
./gentl.sh
cp out/* otl/
- name: Make Artifact
uses: actions/upload-artifact@v3
with:
name: translations
path: otl/*
retention-days: 1
linux-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dlang-community/setup-dlang@4c99aa991ce7d19dd3064de0a4f2f6b2f152e2d7
with:
compiler: ldc-latest
- name: "Get build dependencies"
run: |
sudo apt install libsdl2-dev libfreetype6-dev gettext
- name: 'Generate i18n'
run: |
sudo chmod +x ./gentl.sh
./gentl.sh
- name: "Clone dependencies & set versions"
run: |
git clone https://github.com/Inochi2D/i2d-imgui.git --recurse-submodules
git clone https://github.com/Inochi2D/inochi2d.git
git clone https://github.com/Inochi2D/dcv-i2d
dub add-local i2d-imgui/ "0.8.0"
dub add-local inochi2d/ "0.8.0"
dub add-local dcv-i2d/ "0.3.0"
- name: 'Build Inochi Creator'
run: |
# Build metadata (like version information and icons)
dub build --config=meta
# Build the project, with its main file included, without unittests
dub build --compiler=ldc2 --build=release --config=linux-full
- name: Archive Zip
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: 'inochi-creator-linux-x86_64.zip'
directory: 'out/'
path: '*'
- name: 'Release ZIP'
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: 'out/inochi-creator-linux-x86_64.zip'
- name: 'Publish to Itch'
uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: linux
ITCH_GAME: inochi-creator
ITCH_USER: LunaFoxgirlVT
VERSION_FILE: version.txt
PACKAGE: 'out/inochi-creator-linux-x86_64.zip'
windows-build:
runs-on: windows-latest
needs: build-resources
steps:
- uses: actions/checkout@v3
- uses: dlang-community/setup-dlang@4c99aa991ce7d19dd3064de0a4f2f6b2f152e2d7
with:
compiler: ldc-latest
- name: Download translations
uses: actions/download-artifact@v3
with:
name: translations
path: out/i18n/
- name: "Clone dependencies & set versions"
run: |
git clone https://github.com/Inochi2D/i2d-imgui.git --recurse-submodules
git clone https://github.com/Inochi2D/inochi2d.git
git clone https://github.com/Inochi2D/dcv-i2d
dub add-local i2d-imgui/ "0.8.0"
dub add-local inochi2d/ "0.8.0"
dub add-local dcv-i2d/ "0.3.0"
- name: 'Build Inochi Creator'
run: |
function Invoke-VSDevEnvironment {
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$installationPath = & $vswhere -prerelease -legacy -latest -property installationPath
$Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat"
& "${env:COMSPEC}" /s /c "`"$Command`" -no_logo && set" | Foreach-Object {
if ($_ -match '^([^=]+)=(.*)') {
[System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
}
}
}
Invoke-VSDevEnvironment
# Build metadata (like version information and icons)
dub build --config=meta
# Build the project, with its main file included, without unittests
dub build --compiler=ldc2 --build=release --config=win32-full
- name: Archive Zip
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: 'inochi-creator-win32-x86_64.zip'
directory: 'out/'
path: '*'
- name: 'Add msbuild to PATH'
uses: microsoft/[email protected]
- name: 'Build MSI'
run: |
cd build-aux/windows/wix
# Install required dependency
mkdir packages/
nuget install WixToolset.UI.wixext -version 4.0.0 -OutputDirectory packages/
# Build solution
msbuild "Inochi Creator.sln" -property:Configuration=Release
# Copy installer out
mv "bin/Release/Inochi Creator.msi" "../../../out/inochi-creator-win32-x86_64.msi"
cd ../../../
- name: 'Release'
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
out/inochi-creator-win32-x86_64.msi
out/inochi-creator-win32-x86_64.zip
- name: Make Artifact of ZIP
uses: actions/upload-artifact@v3
with:
name: release-win32
path: |
out/inochi-creator-win32-x86_64.zip
version.txt
retention-days: 1
windows-itch:
name: Itch Release (Windows)
runs-on: ubuntu-latest
needs: windows-build
steps:
- name: Download ZIP from artifacts
uses: actions/download-artifact@v3
with:
name: release-win32
- name: 'Publish to Itch'
uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: windows
ITCH_GAME: inochi-creator
ITCH_USER: LunaFoxgirlVT
VERSION_FILE: version.txt
PACKAGE: 'out/inochi-creator-win32-x86_64.zip'
macOS-build:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: LunaTheFoxgirl/setup-dlang@v1
with:
compiler: ldc-latest
- name: "Prepare for DMG packing"
continue-on-error: true
run: |
export HOMEBREW_NO_INSTALL_CLEANUP=1
brew update
brew install create-dmg gettext
- name: "Remove conflicting brew packages"
continue-on-error: true
run: |
# Remove conflicting brew items
brew remove --ignore-dependencies aom cairo composer curl fontconfig freetype gd ghostscript httpd imagemagick jpeg-xl libavif libheif libxft [email protected] mongosh node@16 openjpeg php r sox webp libpng brotli
- name: "Remove final conflicting files"
continue-on-error: true
run: |
# Delete fake harfbuzz if need be
if [ -f "/usr/local/lib/libharfbuzz.dylib" ]; then
sudo rm -r /usr/local/lib/libharfbuzz.dylib
fi
# And the .a for it as well
if [ -f "/usr/local/lib/libharfbuzz.a" ]; then
sudo rm -r /usr/local/lib/libharfbuzz.a
fi
- name: 'Generate i18n'
run: |
sudo chmod +x ./gentl.sh
./gentl.sh
- name: "Clone dependencies & set versions"
run: |
git clone https://github.com/Inochi2D/i2d-imgui.git --recurse-submodules
git clone https://github.com/Inochi2D/inochi2d.git
git clone https://github.com/Inochi2D/dcv-i2d
dub add-local i2d-imgui/ "0.8.0"
dub add-local inochi2d/ "0.8.0"
dub add-local dcv-i2d/ "0.3.0"
- name: 'Build Inochi Creator'
env:
DFLAGS: "-force-dwarf-frame-section=false"
run: |
# Build metadata (like version information and icons)
dub build --config=meta
# First build ARM64 version...
echo "Building arm64 binary..."
dub build --build=release --config=osx-full --arch=arm64-apple-macos
mv "out/Inochi Creator.app/Contents/MacOS/inochi-creator" "out/Inochi Creator.app/Contents/MacOS/inochi-creator-arm64"
# Then the X86_64 version...
echo "Building x86_64 binary..."
dub build --build=release --config=osx-full --arch=x86_64-apple-macos
mv "out/Inochi Creator.app/Contents/MacOS/inochi-creator" "out/Inochi Creator.app/Contents/MacOS/inochi-creator-x86_64"
# Glue them together with lipo
echo "Gluing them together..."
lipo "out/Inochi Creator.app/Contents/MacOS/inochi-creator-x86_64" "out/Inochi Creator.app/Contents/MacOS/inochi-creator-arm64" -output "out/Inochi Creator.app/Contents/MacOS/inochi-creator" -create
# Print some nice info
echo "Done!"
lipo -info "out/Inochi Creator.app/Contents/MacOS/inochi-creator"
# Cleanup and bundle
echo "Cleaning up..."
rm "out/Inochi Creator.app/Contents/MacOS/inochi-creator-x86_64" "out/Inochi Creator.app/Contents/MacOS/inochi-creator-arm64"
./build-aux/osx/osxbundle.sh
- name: Archive Zip
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: 'inochi-creator-macOS.zip'
directory: 'out/'
path: '*'
- name: Make Artifact of ZIP
uses: actions/upload-artifact@v3
with:
name: release-osx
path: |
out/inochi-creator-macOS.zip
version.txt
retention-days: 1
- name: 'Build DMG'
run: |
./build-aux/osx/gendmg.sh
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: out/Install_Inochi_Creator.dmg
macOS-itch:
name: Itch Release (macOS)
runs-on: ubuntu-latest
needs: macOS-build
steps:
- name: Download DMG from artifacts
uses: actions/download-artifact@v3
with:
name: release-osx
- name: 'Publish to Itch'
uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: osx
ITCH_GAME: inochi-creator
ITCH_USER: LunaFoxgirlVT
VERSION_FILE: version.txt
PACKAGE: out/inochi-creator-macOS.zip