diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000000..3bcd849df1 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,81 @@ +on: + push: + pull_request: + branches: + - beta + paths-ignore: + - '**.md' + +name: Nightly release + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest] # TODO: macos-13 + include: + - os: ubuntu-latest + name: Ubuntu x86_64 + arch: x86_64 + install: sudo apt-get update && sudo apt-get install -y libasound2-dev libgl-dev libglu1-mesa-dev libgtk-3-dev libjack-dev libmad0-dev libpulse-dev libudev-dev libxinerama-dev libx11-dev libxrandr-dev libxtst-dev nasm + configure: cmake -B build -DWITH_FFMPEG_JOBS="$(nproc)" + release: | + cmake -B build -DCMAKE_BUILD_TYPE=Release -DWITH_FULL_RELEASE=Off -DWITH_NIGHTLY_RELEASE=On -DWITH_CLUB_FANTASTIC=Off + cmake --build build --target package + path: build/ITGmania-*-NIGHTLY-git-*-Linux-no-songs.tar.gz + - os: ubuntu-24.04-arm + name: Ubuntu ARM + arch: arm + install: sudo apt-get update && sudo apt-get install -y libasound2-dev libgl-dev libglu1-mesa-dev libgtk-3-dev libjack-dev libmad0-dev libpulse-dev libudev-dev libxinerama-dev libx11-dev libxrandr-dev libxtst-dev nasm + configure: cmake -B build -DWITH_FFMPEG_JOBS="$(nproc)" -DWITH_MINIMAID=OFF + release: | + cmake -B build -DCMAKE_BUILD_TYPE=Release -DWITH_FULL_RELEASE=Off -DWITH_NIGHTLY_RELEASE=On -DWITH_CLUB_FANTASTIC=Off + cmake --build build --target package + path: build/ITGmania-*-NIGHTLY-git-*-Linux-no-songs.tar.gz + - os: macos-latest + name: macOS (M1) + arch: arm64 + install: brew install nasm + configure: cmake -B build -DCMAKE_OSX_ARCHITECTURES=arm64 -DWITH_FFMPEG_JOBS="$(sysctl -n hw.logicalcpu)" + release: | + cmake -B build -DCMAKE_BUILD_TYPE=Release -DWITH_FULL_RELEASE=Off -DWITH_NIGHTLY_RELEASE=On -DCMAKE_OSX_ARCHITECTURES=arm64 -DWITH_CLUB_FANTASTIC=Off + cmake --build build --target package + path: build/ITGmania-*-NIGHTLY-git-*-macOS-M1-no-songs.dmg + - os: windows-latest + name: Windows + arch: x64 + install: | + $vsPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath + &"$vsPath\VC\Auxiliary\Build\vcvarsall.bat" x64 + configure: cmake -B build -DWITH_FFMPEG_JOBS="$env:NUMBER_OF_PROCESSORS" + release: | + cmake -B build -DWITH_FULL_RELEASE=Off -DWITH_NIGHTLY_RELEASE=On -DWITH_CLUB_FANTASTIC=Off + cmake --build build --config Release --target package + path: build/ITGmania-*-NIGHTLY-git-*-Windows-no-songs.exe + name: ${{ matrix.name }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Cache CMake build directory + uses: actions/cache@v4 + with: + path: | + build/* + !${{ matrix.path }} + key: ${{ runner.os }}-${{ matrix.arch }}-cmake-build-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.arch }}-cmake-build- + - name: Install dependencies + run: ${{ matrix.install }} + - name: Configure + run: ${{ matrix.configure }} + - name: Create nightly release + run: ${{ matrix.release }} + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ITGmania-${{ github.sha }}-${{ matrix.name }}-${{ matrix.arch }} + path: ${{ matrix.path }} + compression-level: 0 diff --git a/CMake/DefineOptions.cmake b/CMake/DefineOptions.cmake index f1a47e1c95..62f7b09c63 100644 --- a/CMake/DefineOptions.cmake +++ b/CMake/DefineOptions.cmake @@ -15,6 +15,9 @@ option(WITH_SSE2 "Build with SSE2 Optimizations." ON) # Turn this on to set this to a specific release mode. option(WITH_FULL_RELEASE "Build as a proper, full release." OFF) +# Turn this on to set this to a specific release mode. +option(WITH_NIGHTLY_RELEASE "Build as a nightly release." OFF) + # Turn this on to include Club Fantastic songs option(WITH_CLUB_FANTASTIC "Include Club Fantastic songs." OFF) diff --git a/CMake/SMDefs.cmake b/CMake/SMDefs.cmake index 72fc38cd93..ef29d10570 100644 --- a/CMake/SMDefs.cmake +++ b/CMake/SMDefs.cmake @@ -21,16 +21,26 @@ if(NOT (ret STREQUAL "0")) set(SM_VERSION_GIT "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}") else() - set(SM_VERSION_GIT - "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}-${SM_VERSION_GIT_HASH}") + if(WITH_NIGHTLY_RELEASE) + set(SM_VERSION_GIT + "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}-NIGHTLY-${SM_VERSION_GIT_HASH}") + else() + set(SM_VERSION_GIT + "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}-BETA-${SM_VERSION_GIT_HASH}") + endif() endif() else() if(WITH_FULL_RELEASE) set(SM_VERSION_GIT "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}") else() - set(SM_VERSION_GIT - "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}-git-${SM_VERSION_GIT_HASH}") + if(WITH_NIGHTLY_RELEASE) + set(SM_VERSION_GIT + "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}-NIGHTLY-git-${SM_VERSION_GIT_HASH}") + else() + set(SM_VERSION_GIT + "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}-BETA-git-${SM_VERSION_GIT_HASH}") + endif() endif() endif()