Skip to content

Nightly

Nightly #769

Workflow file for this run

name: Nightly
on:
schedule:
- cron: '0 0 * * *'
jobs:
check_nightly:
if: github.repository == 'f3d-app/f3d-superbuild'
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@v4
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
cache_lfs:
needs: check_nightly
runs-on: ubuntu-latest
name: Update LFS data cache
outputs:
lfs_sha: ${{ steps.lfs_sha_recover.outputs.lfs_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: 'source'
fetch-depth: 1
lfs: false
- name: Cache LFS Data
id: lfs_sha_recover
uses: f3d-app/lfs-data-cache-action@v1
with:
cache_postfix: cache-0
windows:
needs: [check_nightly, cache_lfs]
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@v4
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}}
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}
- 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, cache_lfs]
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
matrix:
raytracing_label: [raytracing, no-raytracing]
runs-on: ubuntu-latest
container: ghcr.io/f3d-app/f3d-superbuild-ci
env:
DISPLAY: :0
steps:
- name: Checkout
uses: actions/checkout@v4
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}}
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}
- 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.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, cache_lfs]
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
matrix:
cpu: [x86_64, arm64]
raytracing_label: [raytracing, no-raytracing]
include:
- cpu: x86_64
macos: macos-13
- cpu: arm64
macos: macos-14
runs-on: ${{matrix.macos}}
steps:
- name: Checkout
uses: actions/checkout@v4
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}}
cpu: ${{matrix.cpu}}
lfs_sha: ${{ needs.cache_lfs.outputs.lfs_sha}}
- 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-latest, windows-latest, macos-latest]
runs-on: ${{matrix.os}}
env:
DISPLAY: :0
steps:
- name: Checkout
uses: actions/checkout@v4
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 release"
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@v4
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
pypi-publish:
needs: [check_nightly, python_wheels]
if: ${{ needs.check_nightly.outputs.should_run == 'true' }}
strategy:
fail-fast: false
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/f3d
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/