Skip to content

🌙 Nightly Builds #12

🌙 Nightly Builds

🌙 Nightly Builds #12

name: 🌙 Nightly Builds
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
build_linux_clang:
name: "🐧 Linux (Clang, Nightly)"
uses: ./.github/workflows/linux_build.yml
with:
jobName: "Linux Clang Nightly Build"
artifactPrefixName: "myMCpp-nightly-linux-x64-clang"
compiler: clang
fetchTags: true
secrets: inherit
build_linux_gcc:
name: "🐧 Linux (GCC, Nightly)"
uses: ./.github/workflows/linux_build.yml
with:
jobName: "Linux GCC Nightly Build"
artifactPrefixName: "myMCpp-nightly-linux-x64-gcc"
compiler: gcc
fetchTags: true
secrets: inherit
build_macos:
name: "🍎 macOS (Nightly)"
uses: ./.github/workflows/macos_build.yml
with:
jobName: "macOS Nightly Build"
artifactPrefixName: "myMCpp-nightly-macos-universal"
fetchTags: true
secrets: inherit
build_windows_x64_clang:
name: "🪟 Windows x64 (Clang, Nightly)"
uses: ./.github/workflows/windows_build.yml
with:
jobName: "Windows x64 Clang Nightly Build"
artifactPrefixName: "myMCpp-nightly-windows-x64-clang"
platform: x64
compiler: clang
fetchTags: true
secrets: inherit
build_windows_x64_msvc:
name: "🪟 Windows x64 (MSVC, Nightly)"
uses: ./.github/workflows/windows_build.yml
with:
jobName: "Windows x64 MSVC Nightly Build"
artifactPrefixName: "myMCpp-nightly-windows-x64-msvc"
platform: x64
compiler: msvc
fetchTags: true
secrets: inherit
build_windows_arm64_clang:
name: "🪟 Windows ARM64 (Clang, Nightly)"
uses: ./.github/workflows/windows_build.yml
with:
jobName: "Windows ARM64 Clang Nightly Build"
artifactPrefixName: "myMCpp-nightly-windows-arm64-clang"
os: windows-11-arm
platform: ARM64
compiler: clang
fetchTags: true
secrets: inherit
build_windows_arm64_msvc:
name: "🪟 Windows ARM64 (MSVC, Nightly)"
uses: ./.github/workflows/windows_build.yml
with:
jobName: "Windows ARM64 MSVC Nightly Build"
artifactPrefixName: "myMCpp-nightly-windows-arm64-msvc"
os: windows-11-arm
platform: ARM64
compiler: msvc
fetchTags: true
secrets: inherit
nightly_release:
name: "📦 Create Nightly Pre-Release"
runs-on: ubuntu-latest
needs:
- build_linux_clang
- build_linux_gcc
- build_macos
- build_windows_x64_clang
- build_windows_x64_msvc
- build_windows_arm64_clang
- build_windows_arm64_msvc
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
- name: Determine nightly tag
id: nightly_tag
shell: bash
run: |
DATE="$(date +'%Y%m%d')"
TAG="nightly-${DATE}"
NAME="myMCpp Nightly ${DATE}"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "name=${NAME}" >> "$GITHUB_OUTPUT"
- name: Download all artifacts
uses: actions/download-artifact@v8.0.1
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts/
- name: Prepare release assets
shell: bash
run: |
mkdir -p release-assets
TAG="${{ steps.nightly_tag.outputs.tag }}"
for dir in artifacts/*/; do
dirname="$(basename "$dir")"
# Skip symbol artifacts
if [[ "$dirname" == *"-symbols" ]]; then
continue
fi
echo "Processing: $dirname"
# Windows artifacts: zip the directory contents
if [[ "$dirname" == *"windows"* ]]; then
asset_name="myMCpp-${TAG}-${dirname#myMCpp-nightly-}.zip"
echo " -> Creating $asset_name"
cd "$dir"
zip -r "../../release-assets/$asset_name" ./*
cd ../..
# macOS artifacts: move the .tar.xz as-is
elif [[ "$dirname" == *"macos"* ]]; then
for f in "$dir"*.tar.xz; do
if [ -f "$f" ]; then
asset_name="myMCpp-${TAG}-${dirname#myMCpp-nightly-}.tar.xz"
echo " -> Moving to $asset_name"
cp "$f" "release-assets/$asset_name"
fi
done
# Linux artifacts: move AppImage as-is
elif [[ "$dirname" == *"linux"* ]]; then
for f in "$dir"*.AppImage; do
if [ -f "$f" ]; then
asset_name="myMCpp-${TAG}-${dirname#myMCpp-nightly-}.AppImage"
echo " -> Moving to $asset_name"
cp "$f" "release-assets/$asset_name"
fi
done
fi
done
echo ""
echo "=== Final release assets ==="
ls -la release-assets/
- name: Create GitHub pre-release with assets
uses: softprops/action-gh-release@v2.5.0
with:
tag_name: ${{ steps.nightly_tag.outputs.tag }}
name: ${{ steps.nightly_tag.outputs.name }}
target_commitish: ${{ github.sha }}
prerelease: true
draft: false
make_latest: false
generate_release_notes: true
files: |
release-assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}