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

103 lines
4.5 KiB
YAML

name: Tahoma2D Windows Build
on: [push, pull_request]
jobs:
Windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Install Dependencies
run: |
ci-scripts\windows\tahoma-install.bat
choco install ccache
copy C:\ProgramData\chocolatey\lib\ccache\tools\ccache*\ccache.exe C:\ProgramData\chocolatey\bin\cl.exe
mkdir %LOCALAPPDATA%\ccache
- uses: actions/cache@v3
with:
path: |
~/AppData/Local/ccache
key: ${{ runner.os }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-
- name: Get CanonSDK
if: ${{ github.repository_owner == 'tahoma2d' && github.event_name == 'push' }}
run: |
curl -H "Authorization: token ${{ secrets.TAHOMA2D_TOKEN }}" -H "Accept:application/octet-stream" -fsSL -o EDSDK_Windows.zip https://api.github.com/repos/tahoma2d/CanonSDK/releases/assets/132789036
7z x EDSDK_Windows.zip -oEDSDK_Windows
move EDSDK_Windows\EDSDK\Header thirdparty\canon
move EDSDK_Windows\EDSDK_64\Dll thirdparty\canon
move EDSDK_Windows\EDSDK_64\Library thirdparty\canon
- name: Get 3rd Party Apps
run: |
ci-scripts\windows\tahoma-get3rdpartyapps.bat
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Build Tahoma2D
run: |
ci-scripts\windows\tahoma-build.bat
- name: Create Package
run: |
ci-scripts\windows\tahoma-buildpkg.bat
mkdir artifact
cp -r toonz\build\Tahoma2D artifact
- uses: actions/upload-artifact@v1
with:
name: Tahoma2D-portable-win
path: artifact
- uses: actions/upload-artifact@v1
with:
name: Tahoma2D-install-win.exe
path: toonz\build\Tahoma2D-install-win.exe
- name: Get Nightly Release Date
if: ${{ github.repository_owner == 'tahoma2d' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
chcp 65001 #set code page to utf-8
echo ("NIGHTLYDATE=" + (Get-Date -format "yyyy-MM-dd")) >> $env:GITHUB_ENV
echo ("NIGHTLYDATETIME=" + (Get-Date -format "yyyy-MM-dd HH:mm:ss UTC")) >> $env: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-win.zip,toonz\build\Tahoma2D-install-win.exe
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-win.zip,toonz\build\Tahoma2D-install-win.exe
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 }}