tahoma2d/.github/workflows/linux_build.yml
2023-04-07 15:40:00 -04:00

120 lines
4.8 KiB
YAML

name: Tahoma2D Linux Build
on: [push, pull_request]
jobs:
Linux:
runs-on: ubuntu-20.04
strategy:
matrix:
compiler: [ gcc, clang ]
include:
- compiler: gcc
cc: gcc
cxx: g++
- compiler: clang
cc: clang
cxx: clang++
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |
ci-scripts/linux/tahoma-install.sh
sudo apt-get install ccache
- uses: actions/cache@v3
with:
path: |
/home/runner/.ccache
/home/runner/work/tahoma2d/taoma2d/thirdparty/openh264
/home/runner/work/tahoma2d/taoma2d/thirdparty/ffmpeg
/home/runner/work/tahoma2d/taoma2d/thirdparty/opencv
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.compiler }}-
${{ runner.os }}-
- name: Build ffmpeg
run: |
export CC="ccache ${{ matrix.cc }}"
export CXX="ccache ${{ matrix.cxx }}"
ci-scripts/linux/tahoma-buildffmpeg.sh
- name: Build OpenCV
run: |
export CC="ccache ${{ matrix.cc }}"
export CXX="ccache ${{ matrix.cxx }}"
ci-scripts/linux/tahoma-buildopencv.sh
- name: Build libmypaint
run: |
export CC="ccache ${{ matrix.cc }}"
export CXX="ccache ${{ matrix.cxx }}"
ci-scripts/linux/tahoma-buildlibmypaint.sh
- name: Build libgphoto2
run: |
export CC="ccache ${{ matrix.cc }}"
export CXX="ccache ${{ matrix.cxx }}"
ci-scripts/linux/tahoma-buildlibgphoto2.sh
- name: Build Tahoma2D
run: |
export CC="ccache ${{ matrix.cc }}"
export CXX="ccache ${{ matrix.cxx }}"
ci-scripts/linux/tahoma-build.sh
- name: Get 3rd Party Apps
run: |
ci-scripts/linux/tahoma-get3rdpartyapps.sh
- name: Create Package
run: |
ci-scripts/linux/tahoma-buildpkg.sh
mv toonz/build/Tahoma2D-linux.tar.gz toonz/build/Tahoma2D-linux-${{ matrix.compiler }}.tar.gz
- uses: actions/upload-artifact@v1
with:
name: Tahoma2D-linux-${{ matrix.compiler }}.tar.gz
path: toonz/build/Tahoma2D-linux-${{ matrix.compiler }}.tar.gz
- 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-linux-${{ matrix.compiler }}.tar.gz
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-linux-${{ matrix.compiler }}.tar.gz
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 }}