Nightly #333
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
check_nightly: | |
runs-on: ubuntu-latest | |
name: Check nightly is needed | |
outputs: | |
should_run: ${{ steps.should_run.outputs.should_run }} | |
f3d_sha: ${{ steps.should_run.outputs.f3d_sha }} | |
steps: | |
- name: Checkout F3D | |
uses: actions/checkout@v3 | |
with: | |
repository: f3d-app/f3d | |
fetch-depth: 0 | |
lfs: false | |
- name: check latest commit is not tagged already | |
id: should_run | |
continue-on-error: true | |
run: | | |
test -z "$(git tag --points-at HEAD)" && echo "should_run=true" >> $GITHUB_OUTPUT || echo "should_run=false" >> $GITHUB_OUTPUT | |
echo "f3d_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
windows: | |
needs: check_nightly | |
if: ${{ needs.check_nightly.outputs.should_run == 'true' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
raytracing_label: [raytracing, no-raytracing] | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: 'source' | |
submodules: true | |
lfs: true | |
- name: Build and package F3D | |
uses: ./source/.github/actions/f3d-superbuild/ | |
with: | |
f3d_version: ${{ needs.check_nightly.outputs.f3d_sha}} | |
raytracing_label: ${{matrix.raytracing_label}} | |
- name: Delete previous nightly release assets | |
uses: mknejp/delete-release-assets@v1 | |
with: | |
token: ${{ secrets.SECRET_TOKEN }} | |
repository: f3d-app/f3d | |
tag: nightly | |
assets: "F3D-*-Windows-x86_64${{ matrix.raytracing_label == 'raytracing' && '-raytracing' || null }}.*" | |
fail-if-no-assets: false | |
- name: Publish nightly release | |
uses: ncipollo/release-action@v1 | |
with: | |
owner: f3d-app | |
repo: f3d | |
token: ${{ secrets.SECRET_TOKEN }} | |
prerelease: true | |
allowUpdates: true | |
updateOnlyUnreleased: true | |
tag: nightly | |
name: "Nightly" | |
body: "Automatically generated nightly binary release" | |
artifacts: './build/F3D-*' | |
linux: | |
needs: check_nightly | |
if: ${{ needs.check_nightly.outputs.should_run == 'true' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
raytracing_label: [raytracing, no-raytracing] | |
egl_label: [no-egl, egl] | |
runs-on: ubuntu-latest | |
container: ghcr.io/f3d-app/f3d-superbuild-ci | |
env: | |
DISPLAY: :0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: 'source' | |
submodules: true | |
lfs: true | |
- name: Build and package F3D | |
uses: ./source/.github/actions/f3d-superbuild/ | |
with: | |
f3d_version: ${{ needs.check_nightly.outputs.f3d_sha}} | |
raytracing_label: ${{matrix.raytracing_label}} | |
egl_label: ${{matrix.egl_label}} | |
- name: Delete previous nightly release assets | |
uses: mknejp/delete-release-assets@v1 | |
with: | |
token: ${{ secrets.SECRET_TOKEN }} | |
repository: f3d-app/f3d | |
tag: nightly | |
assets: "F3D-*-Linux-x86_64${{ matrix.egl_label == 'egl' && '-headless' || null }}${{ matrix.raytracing_label == 'raytracing' && '-raytracing' || null }}.*" | |
fail-if-no-assets: false | |
- name: Publish nightly release | |
uses: ncipollo/release-action@v1 | |
with: | |
owner: f3d-app | |
repo: f3d | |
token: ${{ secrets.SECRET_TOKEN }} | |
prerelease: true | |
allowUpdates: true | |
updateOnlyUnreleased: true | |
tag: nightly | |
name: "Nightly" | |
body: "Automatically generated nightly binary release" | |
artifacts: './build/F3D-*' | |
macos: | |
needs: check_nightly | |
if: ${{ needs.check_nightly.outputs.should_run == 'true' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
raytracing_label: [raytracing, no-raytracing] | |
cpu: [x86_64] | |
include: | |
- cpu: arm64 | |
raytracing_label: no-raytracing | |
runs-on: macos-latest | |
env: | |
CMAKE_OSX_ARCHITECTURES: ${{matrix.cpu}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: 'source' | |
submodules: true | |
lfs: true | |
- name: Build and package F3D | |
uses: ./source/.github/actions/f3d-superbuild/ | |
with: | |
f3d_version: ${{ needs.check_nightly.outputs.f3d_sha}} | |
raytracing_label: ${{matrix.raytracing_label}} | |
- name: Delete previous nightly release assets | |
uses: mknejp/delete-release-assets@v1 | |
with: | |
token: ${{ secrets.SECRET_TOKEN }} | |
repository: f3d-app/f3d | |
tag: nightly | |
assets: "F3D-*-macOS-${{ matrix.cpu}}${{ matrix.raytracing_label == 'raytracing' && '-raytracing' || null }}.*" | |
fail-if-no-assets: false | |
- name: Publish nightly release | |
uses: ncipollo/release-action@v1 | |
with: | |
owner: f3d-app | |
repo: f3d | |
token: ${{ secrets.SECRET_TOKEN }} | |
prerelease: true | |
allowUpdates: true | |
updateOnlyUnreleased: true | |
tag: nightly | |
name: "Nightly" | |
body: "Automatically generated nightly binary release" | |
artifacts: './build/F3D-*' | |
python_wheels: | |
needs: check_nightly | |
if: ${{ needs.check_nightly.outputs.should_run == 'true' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu, windows, macos] | |
runs-on: ${{matrix.os}}-latest | |
env: | |
DISPLAY: :0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: 'source' | |
submodules: true | |
lfs: true | |
- name: Build python wheels | |
uses: ./source/.github/actions/wheels/ | |
with: | |
f3d_version: ${{ needs.check_nightly.outputs.f3d_sha}} | |
use_cache: false | |
- name: Delete previous nightly release assets | |
uses: mknejp/delete-release-assets@v1 | |
with: | |
token: ${{ secrets.SECRET_TOKEN }} | |
repository: f3d-app/f3d | |
tag: nightly | |
assets: "f3d-*-${{ runner.os == 'Linux' && 'manylinux' || null }}${{ runner.os == 'Windows' && 'win' || null }}${{ runner.os == 'macOS' && 'macosx' || null }}_*.whl" | |
fail-if-no-assets: false | |
- name: Publish nightly python wheels | |
uses: ncipollo/release-action@v1 | |
with: | |
owner: f3d-app | |
repo: f3d | |
token: ${{ secrets.SECRET_TOKEN }} | |
prerelease: true | |
allowUpdates: true | |
updateOnlyUnreleased: true | |
tag: nightly | |
name: "Nightly" | |
body: "Automatically generated nightly binary python wheels" | |
artifacts: './wheelhouse/f3d-*.whl' | |
advance_nightly: | |
needs: [check_nightly, windows, linux, macos, python_wheels] | |
if: ${{ needs.check_nightly.outputs.should_run == 'true' }} | |
runs-on: ubuntu-latest | |
name: Advance nightly tag | |
steps: | |
- name: Checkout F3D | |
uses: actions/checkout@v3 | |
with: | |
repository: f3d-app/f3d | |
fetch-depth: 0 | |
lfs: false | |
token: ${{ secrets.SECRET_TOKEN }} | |
- name: Advance nightly tag | |
run: | | |
git checkout ${{ needs.check_nightly.outputs.f3d_sha}} | |
git tag nightly -f | |
git push origin nightly -f |