tahoma2d/.github/workflows/macOS_build.yml
2023-10-29 13:11:13 -04:00

119 lines
5.1 KiB
YAML

name: Tahoma2D macOS Build
on: [push, pull_request]
jobs:
macOS:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Install Dependencies
run: |
ci-scripts/osx/tahoma-install.sh
brew install ccache
mkdir /Users/runner/.ccache
- uses: actions/cache@v3
with:
path: |
/Users/runner/.ccache
/Users/runner/work/tahoma2d/taoma2d/thirdparty/aom
/Users/runner/work/tahoma2d/taoma2d/thirdparty/ffmpeg
/Users/runner/work/tahoma2d/taoma2d/thirdparty/opencv
key: ${{ runner.os }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-
- name: Get CanonSDK
if: ${{ github.repository_owner == 'tahoma2d' && github.event_name == 'push' }}
run: |
wget --header="Authorization: token ${{ secrets.TAHOMA2D_TOKEN }}" --header="Accept:application/octet-stream" -O EDSDK_Macintosh.zip https://api.github.com/repos/tahoma2d/CanonSDK/releases/assets/132789028
unzip EDSDK_Macintosh.zip -d EDSDK_Macintosh
unzip EDSDK_Macintosh/Macintosh.dmg.zip -d EDSDK_Macintosh
7z x EDSDK_Macintosh/Macintosh.dmg -oEDSDK_Macintosh
mv EDSDK_Macintosh/Macintosh/EDSDK/* thirdparty/canon
cd thirdparty/canon/framework/EDSDK.framework/Versions
rm Current
ln -s A Current
cd ..
rm Resources EDSDK
ln -s Versions/Current/Resources Resources
ln -s Versions/Current/EDSDK EDSDK
- name: Get 3rd Party Apps
run: |
ci-scripts/osx/tahoma-get3rdpartyapps.sh
- name: Build ffmpeg
run: |
export PATH="/usr/local/opt/ccache/libexec:$PATH"
ci-scripts/osx/tahoma-buildffmpeg.sh
- name: Build OpenCV
run: |
export PATH="/usr/local/opt/ccache/libexec:$PATH"
ci-scripts/osx/tahoma-buildopencv.sh
- name: Build libgphoto2
run: |
export PATH="/usr/local/opt/ccache/libexec:$PATH"
ci-scripts/osx/tahoma-buildlibgphoto2.sh
- name: Build Tahoma2D
run: |
export PATH="/usr/local/opt/ccache/libexec:$PATH"
ci-scripts/osx/tahoma-build.sh
- name: Create Package
run: bash ./ci-scripts/osx/tahoma-buildpkg.sh
- uses: actions/upload-artifact@v1
with:
name: Tahoma2D-portable-osx.dmg
path: toonz/build/Tahoma2D-portable-osx.dmg
- uses: actions/upload-artifact@v1
with:
name: Tahoma2D-install-osx.pkg
path: toonz/build/Tahoma2D-install-osx.pkg
- name: Get Nightly Release Date
if: ${{ github.repository_owner == 'tahoma2d' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
echo "NIGHTLYDATE=$(date '+%Y-%m-%d')" >> $GITHUB_ENV
echo "NIGHTLYDATETIME=$(date '+%Y-%m-%d %H:%M:%S %Z')" >> $GITHUB_ENV
- name: Create/Update Nightlies Tag
if: ${{ github.repository_owner == 'tahoma2d' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
git remote add nightly_repo https://tahoma2d:${{ secrets.TAHOMA2D_TOKEN }}@github.com/tahoma2d/tahoma2d_nightlies.git
git config lfs.https://tahoma2d:${{ secrets.TAHOMA2D_TOKEN }}@github.com/tahoma2d/tahoma2d_nightlies.git.lfs.locksverify false
git fetch --unshallow
git tag -f nightly
git push -f origin nightly
git tag -f nightly-${{ github.sha }}
git config --unset-all http.https://github.com/.extraheader
git push -f nightly_repo nightly-${{ github.sha }}
git remote rm nightly_repo
- name: Update Latest Nightly Release
if: ${{ github.repository_owner == 'tahoma2d' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: false
artifacts: toonz/build/Tahoma2D-portable-osx.dmg,toonz/build/Tahoma2D-install-osx.pkg
artifactContentType: "raw"
body: ${{ github.event.head_commit.message }}
name: Latest Nightly ${{ env.NIGHTLYDATE }}
prerelease: true
replacesArtifacts: true
tag: nightly
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Nightlies Release
if: ${{ github.repository_owner == 'tahoma2d' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: false
artifacts: toonz/build/Tahoma2D-portable-osx.dmg,toonz/build/Tahoma2D-install-osx.pkg
artifactContentType: "raw"
body: ${{ github.event.head_commit.message }}
name: ${{ env.NIGHTLYDATETIME }}
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
owner: tahoma2d
prerelease: true
replacesArtifacts: true
repo: tahoma2d_nightlies
tag: nightly-${{ github.sha }}
token: ${{ secrets.TAHOMA2D_TOKEN }}