Nightly Release #39
This file contains hidden or 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 Release | |
| on: | |
| schedule: | |
| # Run every night at 1 AM EST (6 AM UTC in winter, 5 AM UTC in summer) | |
| # Using 6 AM UTC to account for EST (UTC-5) | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-windows-ds4: | |
| name: Build Windows Plugin (DS4) | |
| uses: ./.github/workflows/build-windows.yml | |
| with: | |
| configuration: Release | |
| sdk-version: '4' | |
| secrets: | |
| sdk-repo-token: ${{ secrets.SDK_REPO_TOKEN }} | |
| build-windows-ds6: | |
| name: Build Windows Plugin (DS6) | |
| uses: ./.github/workflows/build-windows.yml | |
| with: | |
| configuration: Release | |
| sdk-version: '6' | |
| secrets: | |
| sdk-repo-token: ${{ secrets.SDK_REPO_TOKEN }} | |
| build-macos-intel-ds4: | |
| name: Build macOS Intel Plugin (DS4) | |
| uses: ./.github/workflows/build-macos.yml | |
| with: | |
| architecture: x86_64 | |
| configuration: Release | |
| sdk-version: '4' | |
| secrets: | |
| sdk-repo-token: ${{ secrets.SDK_REPO_TOKEN }} | |
| build-macos-arm-ds4: | |
| name: Build macOS Apple Silicon Plugin (DS4) | |
| uses: ./.github/workflows/build-macos.yml | |
| with: | |
| architecture: arm64 | |
| configuration: Release | |
| sdk-version: '4' | |
| secrets: | |
| sdk-repo-token: ${{ secrets.SDK_REPO_TOKEN }} | |
| build-macos-intel-ds6: | |
| name: Build macOS Intel Plugin (DS6) | |
| uses: ./.github/workflows/build-macos.yml | |
| with: | |
| architecture: x86_64 | |
| configuration: Release | |
| sdk-version: '6' | |
| secrets: | |
| sdk-repo-token: ${{ secrets.SDK_REPO_TOKEN }} | |
| build-macos-arm-ds6: | |
| name: Build macOS Apple Silicon Plugin (DS6) | |
| uses: ./.github/workflows/build-macos.yml | |
| with: | |
| architecture: arm64 | |
| configuration: Release | |
| sdk-version: '6' | |
| secrets: | |
| sdk-repo-token: ${{ secrets.SDK_REPO_TOKEN }} | |
| build-dazpy: | |
| name: Build dazpy Wheel | |
| uses: ./.github/workflows/build-dazpy.yml | |
| create-nightly-release: | |
| name: Create Nightly Release | |
| needs: | |
| - build-windows-ds4 | |
| - build-windows-ds6 | |
| - build-macos-intel-ds4 | |
| - build-macos-arm-ds4 | |
| - build-macos-intel-ds6 | |
| - build-macos-arm-ds6 | |
| - build-dazpy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get previous nightly date | |
| id: prev-nightly | |
| run: | | |
| # Try to get the previous nightly release | |
| PREV_NIGHTLY=$(gh release list --limit 100 --json tagName,createdAt --jq '.[] | select(.tagName | startswith("nightly-")) | .tagName' | head -1 || echo "") | |
| echo "prev-nightly=$PREV_NIGHTLY" >> $GITHUB_OUTPUT | |
| if [ -z "$PREV_NIGHTLY" ]; then | |
| echo "No previous nightly found" | |
| else | |
| echo "Previous nightly: $PREV_NIGHTLY" | |
| fi | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Generate commit summary | |
| id: commits | |
| run: | | |
| if [ -z "${{ steps.prev-nightly.outputs.prev-nightly }}" ]; then | |
| # No previous nightly, get commits since last tagged release | |
| LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| if [ -z "$LAST_TAG" ]; then | |
| COMMITS=$(git log --oneline --no-decorate --since="24 hours ago") | |
| else | |
| COMMITS=$(git log --oneline --no-decorate ${LAST_TAG}..HEAD) | |
| fi | |
| else | |
| # Get commits since previous nightly | |
| PREV_COMMIT=$(git rev-list -n 1 ${{ steps.prev-nightly.outputs.prev-nightly }} 2>/dev/null || echo "HEAD~1") | |
| COMMITS=$(git log --oneline --no-decorate ${PREV_COMMIT}..HEAD) | |
| fi | |
| # Check if there are any commits | |
| if [ -z "$COMMITS" ]; then | |
| echo "has-commits=false" >> $GITHUB_OUTPUT | |
| echo "No new commits since last nightly" | |
| else | |
| echo "has-commits=true" >> $GITHUB_OUTPUT | |
| echo "$COMMITS" > commit_summary.txt | |
| fi | |
| - name: Skip if no changes | |
| if: steps.commits.outputs.has-commits == 'false' | |
| run: | | |
| echo "No new commits since last nightly, skipping release" | |
| exit 0 | |
| - name: Get current date | |
| if: steps.commits.outputs.has-commits == 'true' | |
| id: date | |
| run: | | |
| echo "date=$(date -u '+%Y-%m-%d')" >> $GITHUB_OUTPUT | |
| echo "datetime=$(date -u '+%Y-%m-%d %H:%M UTC')" >> $GITHUB_OUTPUT | |
| - name: Generate release notes | |
| if: steps.commits.outputs.has-commits == 'true' | |
| run: | | |
| { | |
| echo "## Nightly Build - ${{ steps.date.outputs.datetime }}" | |
| echo "" | |
| echo "> **Warning:** This is an automated nightly build. It may be unstable." | |
| echo "" | |
| echo "## Recent Changes" | |
| echo "" | |
| if [ -f commit_summary.txt ]; then | |
| echo "\`\`\`" | |
| cat commit_summary.txt | |
| echo "\`\`\`" | |
| else | |
| echo "No changes since last nightly." | |
| fi | |
| echo "" | |
| echo "## Built Artifacts" | |
| echo "" | |
| echo "### DAZ Studio 4.5+" | |
| echo "- **Windows:** \`DazScriptServer-ds4-windows.dll\`" | |
| echo "- **macOS Intel:** \`DazScriptServer-ds4-macos-Intel.dylib\`" | |
| echo "- **macOS Apple Silicon:** \`DazScriptServer-ds4-macos-AppleSilicon.dylib\`" | |
| echo "" | |
| echo "### Daz Studio 6.25+" | |
| echo "- **Windows:** \`dsp_DazScriptServer-ds6-windows.dll\`" | |
| echo "- **macOS Intel:** \`dsp_DazScriptServer-ds6-macos-Intel.dylib\`" | |
| echo "- **macOS Apple Silicon:** \`dsp_DazScriptServer-ds6-macos-AppleSilicon.dylib\`" | |
| echo "" | |
| echo "### Python" | |
| echo "- **Python Package:** \`dazpy-*.whl\`" | |
| } > release_notes.md | |
| - name: Download all artifacts | |
| if: steps.commits.outputs.has-commits == 'true' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Prepare release assets | |
| if: steps.commits.outputs.has-commits == 'true' | |
| run: | | |
| mkdir -p release-assets | |
| # Windows DLLs | |
| cp artifacts/DazScriptServer-windows-ds4-Release/DazScriptServer.dll \ | |
| release-assets/DazScriptServer-ds4-windows.dll | |
| cp artifacts/DazScriptServer-windows-ds6-Release/dsp_DazScriptServer.dll \ | |
| release-assets/dsp_DazScriptServer-ds6-windows.dll | |
| # macOS dylibs | |
| cp artifacts/DazScriptServer-macos-Intel-ds4-Release/DazScriptServer.dylib \ | |
| release-assets/DazScriptServer-ds4-macos-Intel.dylib | |
| cp artifacts/DazScriptServer-macos-AppleSilicon-ds4-Release/DazScriptServer.dylib \ | |
| release-assets/DazScriptServer-ds4-macos-AppleSilicon.dylib | |
| cp artifacts/DazScriptServer-macos-Intel-ds6-Release/dsp_DazScriptServer.dylib \ | |
| release-assets/dsp_DazScriptServer-ds6-macos-Intel.dylib | |
| cp artifacts/DazScriptServer-macos-AppleSilicon-ds6-Release/dsp_DazScriptServer.dylib \ | |
| release-assets/dsp_DazScriptServer-ds6-macos-AppleSilicon.dylib | |
| # dazpy wheel | |
| cp artifacts/dazpy-dist/*.whl release-assets/ | |
| # List all files | |
| echo "Release assets:" | |
| ls -lh release-assets/ | |
| - name: Delete previous nightly release | |
| if: steps.commits.outputs.has-commits == 'true' && steps.prev-nightly.outputs.prev-nightly != '' | |
| run: | | |
| echo "Deleting previous nightly release: ${{ steps.prev-nightly.outputs.prev-nightly }}" | |
| gh release delete ${{ steps.prev-nightly.outputs.prev-nightly }} --yes --cleanup-tag || true | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: Create Nightly Release | |
| if: steps.commits.outputs.has-commits == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Nightly Build - ${{ steps.date.outputs.date }} | |
| tag_name: nightly-${{ github.run_number }} | |
| body_path: release_notes.md | |
| files: | | |
| release-assets/* | |
| draft: false | |
| prerelease: true | |
| generate_release_notes: false |