diff --git a/.github/workflows/build_aux_files.yml b/.github/workflows/build_aux_files.yml index d83ff6112..da8ca1aa4 100644 --- a/.github/workflows/build_aux_files.yml +++ b/.github/workflows/build_aux_files.yml @@ -11,14 +11,46 @@ on: - '*.md' jobs: - upload_github_release: - # Upload artifact linked to GitHub RELEASE we are creating - only if the run is for a pull request, or for selected branches - #if: contains(fromJson('["master", "main"]'), github.ref_name) - + release_dev: + if: github.ref_name == 'dev' permissions: contents: write actions: read + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Reset Dev tag + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git tag -d Dev || true + git push origin :refs/tags/Dev || true + git tag Dev + git push origin Dev + + - name: Generate changelog + run: git log --pretty=format:"%ad %an %s" --date=short > Git-Changelog.txt + - name: Add files to Dev release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: Dev Nightly + tag_name: Dev + prerelease: true + files: | + Git-Changelog.txt + + release_main: + if: contains(fromJson('["master","main"]'), github.ref_name) + permissions: + contents: write + actions: read runs-on: ubuntu-latest steps: - name: Checkout repository @@ -26,6 +58,15 @@ jobs: with: fetch-depth: 0 + - name: Reset Nightly tag + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git tag -d Nightly || true + git push origin :refs/tags/Nightly || true + git tag Nightly + git push origin Nightly + - name: Generate changelog run: git log --pretty=format:"%ad %an %s" --date=short > Git-Changelog.txt @@ -37,4 +78,4 @@ jobs: name: Nightly tag_name: Nightly prerelease: true - files: Git-Changelog.txt + files: Git-Changelog.txt \ No newline at end of file diff --git a/.github/workflows/build_linux_x86.yml b/.github/workflows/build_linux_x86.yml index 534f4ef3e..f84e90b72 100644 --- a/.github/workflows/build_linux_x86.yml +++ b/.github/workflows/build_linux_x86.yml @@ -1,25 +1,23 @@ name: Linux x86 on: + workflow_dispatch: push: -# branches: -# - 'master' -# - 'main' -# - 'dev' - paths-ignore: - - '.gitignore' - - '.gitattributes' - - '**.txt' - - '**.md' - - '**.rc' - pull_request: branches: - 'master' - 'main' - 'dev' paths-ignore: - - '*.txt' - - '*.md' + - '.gitignore' + - '.gitattributes' + - '**.txt' + - '**.md' + - '**.rc' + pull_request: + branches: + - 'master' + - 'main' + - 'dev' jobs: linux-x86: @@ -33,12 +31,13 @@ jobs: uses: actions/checkout@v5 with: fetch-depth: 0 + - name: Install prerequisites run: | lsb_release -d echo && echo "** Setting up repos" && echo - sudo sudo dpkg --add-architecture i386 + sudo dpkg --add-architecture i386 sudo add-apt-repository universe && sudo apt-get -qq update > /dev/null echo "Done" @@ -55,20 +54,18 @@ jobs: wget --quiet --output-document=dep1.deb http://launchpadlibrarian.net/367327733/libssl1.1_1.1.0g-2ubuntu4_i386.deb sudo dpkg -r --force-all libssl1.1 sudo dpkg -i --force-all dep1.deb - #sudo apt install --fix-broken ./dep1.deb echo "Done" # Workaround: there are no official packages built for i386 on this OS. Let's install from previous Ubuntu LTS versions repo. - echo "Downloading MariaDB i386 manually from Bionic repo..." wget --quiet --output-document=temp1.deb http://launchpadlibrarian.net/355877539/libmariadb3_3.0.3-1build1_i386.deb wget --quiet --output-document=temp2.deb http://launchpadlibrarian.net/355877538/libmariadb-dev_3.0.3-1build1_i386.deb - + #echo "Downloading MariaDB i386 manually from Focal repo..." #wget --quiet --output-document=temp1.deb http://launchpadlibrarian.net/448491536/libmariadb3_10.3.18-1_i386.deb # No libmariadb-dev ? #wget --quiet --output-document=temp2.deb http://launchpadlibrarian.net/355877538/libmariadb-dev_3.0.3-1build1_i386.deb - + # Third choice: directly download and install packages from Debian repos? #echo "Packages to be installed by libmariadb3:" #dpkg-deb -c temp1.deb @@ -129,13 +126,37 @@ jobs: overwrite: true + upload_github_release_dev: + needs: linux-x86 + if: github.ref_name == 'dev' + permissions: + contents: write + + runs-on: ubuntu-latest + steps: + - name: Download builds + uses: actions/download-artifact@v5 + with: + name: Build-linux-x86 + merge-multiple: true + run-id: ${{ github.run_id }} + - name: Create DEV release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: Dev Nightly + tag_name: Dev + prerelease: true + files: SphereSvrX-linux-x86-nightly.tar.gz + + upload_github_release: needs: linux-x86 - # Upload artifact linked to GitHub RELEASE we are creating - only if the run is for a pull request, or for selected branches + # Upload artifact linked to GitHub RELEASE we are creating if: contains(fromJson('["master", "main"]'), github.ref_name) permissions: - contents: read - actions: write + contents: write runs-on: ubuntu-latest steps: @@ -146,7 +167,7 @@ jobs: merge-multiple: true run-id: ${{ github.run_id }} - - name: Create release + - name: Create Nightly release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -162,7 +183,6 @@ jobs: if: contains(fromJson('["master", "main"]'), github.ref_name) && (github.repository == 'SphereServer/Source-X') permissions: contents: write - actions: read runs-on: ubuntu-latest steps: @@ -172,6 +192,7 @@ jobs: name: Build-linux-x86 merge-multiple: true run-id: ${{ github.run_id }} + - name: Push release run: | curl -sST "{SphereSvrX-linux-x86-nightly.tar.gz}" -u ${{secrets.UP_USER}}:${{secrets.UP_PASS}} ${{secrets.UP_WHERE}} diff --git a/.github/workflows/build_linux_x86_64.yml b/.github/workflows/build_linux_x86_64.yml index 260c2eb51..cbf91ca96 100644 --- a/.github/workflows/build_linux_x86_64.yml +++ b/.github/workflows/build_linux_x86_64.yml @@ -1,17 +1,18 @@ name: Linux x86_64 on: + workflow_dispatch: push: -# branches: -# - 'master' -# - 'main' -# - 'dev' - paths-ignore: - - '.gitignore' - - '.gitattributes' - - '**.txt' - - '**.md' - - '**.rc' + branches: + - 'master' + - 'main' + - 'dev' + paths-ignore: + - '.gitignore' + - '.gitattributes' + - '**.txt' + - '**.md' + - '**.rc' pull_request: branches: - 'master' @@ -21,78 +22,63 @@ on: jobs: linux-x86_64: runs-on: ubuntu-24.04 - permissions: - contents: read - actions: read steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Install prerequisites - run: | - lsb_release -d - - sudo add-apt-repository universe && sudo sudo apt-get -qq update - sudo apt-get install -yq --no-install-recommends \ - ninja-build gcc-12 g++-12 \ - ccache \ - mariadb-client libmariadb-dev - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90 --slave /usr/bin/g++ g++ /usr/bin/g++-12 - - - name: Set up ccache - uses: hendrikmuhs/ccache-action@v1 - with: - key: ${{github.job}} - - - name: Configure ccache - run: ccache --set-config sloppiness="include_file_mtime, include_file_ctime, time_macros, pch_defines" - - - name: Report building tools - run: | - echo "GCC:" && gcc -v - echo "Default Linker:" && ld -v - echo && echo "CMake:" && cmake --version - echo && echo "Ninja:" && ninja --version - - - name: CMake - run: | - mkdir -p build - cmake -G "Ninja" -DCMAKE_BUILD_TYPE="Nightly" \ - -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/Linux-GNU-x86_64.cmake \ - -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_C_FLAGS="-fpch-preprocess" \ - -DCMAKE_CXX_FLAGS="-fpch-preprocess" \ - -S ./ -B ./build - - name: Ninja - run: ninja -C build -v - - name: Create package - run: | - mkdir accounts logs save scripts - tar -czf SphereSvrX-linux-x86_64-nightly.tar.gz accounts/ logs/ save/ scripts/ -C build/bin-x86_64/ SphereSvrX64_nightly -C ../../src sphere.ini sphereCrypt.ini - - # Upload artifact linked to the workflow run - only if the run is for a pull request, or for selected branches - - name: Upload artifact - if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || ${{ github.event_name == 'pull_request' }} - uses: actions/upload-artifact@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - name: Build-linux-x86_64 - path: SphereSvrX-linux-x86_64-nightly.tar.gz - overwrite: true - - - upload_github_release: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Install prerequisites + run: | + lsb_release -d + sudo add-apt-repository universe && sudo apt-get -qq update + sudo apt install -yq --no-install-recommends ninja-build gcc-12 g++-12 > /dev/null + sudo apt install -yq --no-install-recommends mariadb-client libmariadb-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-12 + + - name: Report building tools + run: | + echo "GCC:" && gcc -v + echo "CMake:" && cmake --version + echo "Ninja:" && ninja --version + + - name: CMake + run: | + mkdir -p build + cmake -G "Ninja" \ + -DCMAKE_BUILD_TYPE="Nightly" \ + -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/Linux-GNU-x86_64.cmake \ + -S ./ -B ./build + + - name: Ninja + run: cd build && ninja && cd .. + + - name: Create package + run: | + mkdir accounts logs save scripts + tar -czf SphereSvrX-linux-x86_64-nightly.tar.gz accounts/ logs/ save/ scripts/ \ + -C build/bin-x86_64/ SphereSvrX64_nightly \ + -C ../../src sphere.ini sphereCrypt.ini + + - name: Upload artifact + if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || ${{ github.event_name == 'pull_request' }} + uses: actions/upload-artifact@v4 + with: + name: Build-linux-x86_64 + path: SphereSvrX-linux-x86_64-nightly.tar.gz + overwrite: true + + # -------- Release job for master/main → "Nightly" -------- + upload_github_release_main: needs: linux-x86_64 - # Upload artifact linked to GitHub RELEASE we are creating - only if the run is for a pull request, or for selected branches if: contains(fromJson('["master", "main"]'), github.ref_name) + runs-on: ubuntu-latest permissions: - contents: read + contents: write actions: write - runs-on: ubuntu-latest steps: - name: Download builds uses: actions/download-artifact@v5 @@ -101,7 +87,7 @@ jobs: merge-multiple: true run-id: ${{ github.run_id }} - - name: Create release + - name: Upload to Nightly release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -111,14 +97,42 @@ jobs: prerelease: true files: SphereSvrX-linux-x86_64-nightly.tar.gz + # -------- Release job for dev → "Dev Nightly" -------- + upload_github_release_dev: + needs: linux-x86_64 + if: github.ref_name == 'dev' + runs-on: ubuntu-latest + permissions: + contents: write + actions: write + + steps: + - name: Download builds + uses: actions/download-artifact@v5 + with: + name: Build-linux-x86_64 + merge-multiple: true + run-id: ${{ github.run_id }} + + - name: Upload to Dev Nightly release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: Dev Nightly + tag_name: Dev + prerelease: true + files: SphereSvrX-linux-x86_64-nightly.tar.gz + + # -------- Self-host upload only for master/main on official repo -------- upload_selfhost_release: needs: linux-x86_64 if: contains(fromJson('["master", "main"]'), github.ref_name) && (github.repository == 'SphereServer/Source-X') + runs-on: ubuntu-latest permissions: contents: write actions: read - runs-on: ubuntu-latest steps: - name: Download builds uses: actions/download-artifact@v5 @@ -126,6 +140,7 @@ jobs: name: Build-linux-x86_64 merge-multiple: true run-id: ${{ github.run_id }} + - name: Push release run: | curl -sST "{SphereSvrX-linux-x86_64-nightly.tar.gz}" -u ${{secrets.UP_USER}}:${{secrets.UP_PASS}} ${{secrets.UP_WHERE}} diff --git a/.github/workflows/build_osx_arm.yml b/.github/workflows/build_osx_arm.yml index 416d72397..fd9377e45 100644 --- a/.github/workflows/build_osx_arm.yml +++ b/.github/workflows/build_osx_arm.yml @@ -1,17 +1,18 @@ name: MacOS ARM on: + workflow_dispatch: push: -# branches: -# - 'master' -# - 'main' -# - 'dev' - paths-ignore: - - '.gitignore' - - '.gitattributes' - - '**.txt' - - '**.md' - - '**.rc' + branches: + - 'master' + - 'main' + - 'dev' + paths-ignore: + - '.gitignore' + - '.gitattributes' + - '**.txt' + - '**.md' + - '**.rc' pull_request: branches: - 'master' @@ -21,68 +22,65 @@ on: jobs: macos-arm64: runs-on: macos-15 # apple silicon - permissions: - contents: read - actions: read - env: CMAKE_GEN: Ninja #CMAKE_TCH: cmake/toolchains/OSX-AppleClang-native.cmake CMAKE_TCH: cmake/toolchains/OSX-AppleClang-AArch64.cmake steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Install prerequisites - run: | - sw_vers - - echo && echo "** Setting up compiler" && echo - export HOMEBREW_NO_AUTO_UPDATE=1 - export HOMEBREW_NO_INSTALL_CLEANUP=1 - brew install mariadb-connector-c - - - name: Report building tools - run: | - echo "Apple Clang:" && clang --version - echo "Default Linker:" && ld -v - echo && echo "CMake:" && cmake --version - echo && echo "Ninja:" && ninja --version - - - name: CMake - run: | - mkdir -p build - cmake -G "Ninja" -DCMAKE_BUILD_TYPE="Nightly" -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TCH" -S . -B ./build - - name: Ninja - run: ninja -C build -v - - name: Create package - run: | - pwd - mkdir accounts logs save scripts - zip -rj SphereSvrX-osx-arm64-nightly.zip accounts/ logs/ save/ scripts/ src/sphere.ini src/sphereCrypt.ini build/bin-aarch64/* - - # Upload artifact linked to the workflow run - only if the run is for a pull request, or for selected branches - - name: Upload artifact - if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || ${{ github.event_name == 'pull_request' }} - uses: actions/upload-artifact@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - name: Build-osx-arm64 - path: SphereSvrX-osx-arm64-nightly.zip - overwrite: true - - - upload_github_release: - needs: macos-arm64 # Upload artifact linked to GitHub RELEASE we are creating - only if the run is for a pull request, or for selected branches + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Install prerequisites + run: | + sw_vers + echo "** Setting up compiler" + export HOMEBREW_NO_AUTO_UPDATE=1 + export HOMEBREW_NO_INSTALL_CLEANUP=1 + brew install ninja mariadb-connector-c + + - name: Report building tools + run: | + echo "Apple Clang:" && clang --version + echo "CMake:" && cmake --version + echo "Ninja:" && ninja --version + + - name: CMake + run: | + mkdir -p build + cmake -G "Ninja" \ + -DCMAKE_BUILD_TYPE="Nightly" \ + -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TCH" \ + -S . -B ./build + + - name: Ninja + run: cd build && ninja && cd .. + + - name: Create package + run: | + mkdir accounts logs save scripts + zip -rj SphereSvrX-osx-arm64-nightly.zip accounts/ logs/ save/ scripts/ \ + src/sphere.ini src/sphereCrypt.ini build/bin-aarch64/* + + - name: Upload artifact + if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || github.event_name == 'pull_request' + uses: actions/upload-artifact@v4 + with: + name: Build-osx-arm64 + path: SphereSvrX-osx-arm64-nightly.zip + overwrite: true + + # -------- Release job for master/main → "Nightly" -------- + upload_github_release_main: + needs: macos-arm64 if: contains(fromJson('["master", "main"]'), github.ref_name) + runs-on: ubuntu-latest permissions: - contents: read + contents: write actions: write - runs-on: ubuntu-latest steps: - name: Download builds uses: actions/download-artifact@v5 @@ -91,7 +89,7 @@ jobs: merge-multiple: true run-id: ${{ github.run_id }} - - name: Create release + - name: Upload to Nightly release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -101,15 +99,42 @@ jobs: prerelease: true files: SphereSvrX-osx-arm64-nightly.zip + # -------- Release job for dev → "Dev Nightly" -------- + upload_github_release_dev: + needs: macos-arm64 + if: github.ref_name == 'dev' + runs-on: ubuntu-latest + permissions: + contents: write + actions: write + + steps: + - name: Download builds + uses: actions/download-artifact@v5 + with: + name: Build-osx-arm64 + merge-multiple: true + run-id: ${{ github.run_id }} + + - name: Upload to Dev Nightly release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: Dev Nightly + tag_name: Dev + prerelease: true + files: SphereSvrX-osx-arm64-nightly.zip + # -------- Self-host upload only for master/main on official repo -------- upload_selfhost_release: needs: macos-arm64 if: contains(fromJson('["master", "main"]'), github.ref_name) && (github.repository == 'SphereServer/Source-X') + runs-on: ubuntu-latest permissions: contents: write actions: read - runs-on: ubuntu-latest steps: - name: Download builds uses: actions/download-artifact@v5 @@ -117,6 +142,7 @@ jobs: name: Build-osx-arm64 merge-multiple: true run-id: ${{ github.run_id }} + - name: Push release run: | curl -sST "{SphereSvrX-osx-arm64-nightly.zip}" -u ${{secrets.UP_USER}}:${{secrets.UP_PASS}} ${{secrets.UP_WHERE}} diff --git a/.github/workflows/build_osx_x86_64.yml b/.github/workflows/build_osx_x86_64.yml index 281f5e91f..d1ec96c61 100644 --- a/.github/workflows/build_osx_x86_64.yml +++ b/.github/workflows/build_osx_x86_64.yml @@ -1,17 +1,18 @@ name: MacOS x86_64 on: + workflow_dispatch: push: -# branches: -# - 'master' -# - 'main' -# - 'dev' - paths-ignore: - - '.gitignore' - - '.gitattributes' - - '**.txt' - - '**.md' - - '**.rc' + branches: + - 'master' + - 'main' + - 'dev' + paths-ignore: + - '.gitignore' + - '.gitattributes' + - '**.txt' + - '**.md' + - '**.rc' pull_request: branches: - 'master' @@ -20,68 +21,65 @@ on: jobs: macos-x86_64: - runs-on: macos-15-intel - permissions: - contents: read - actions: read - + runs-on: macos-15-intel env: CMAKE_GEN: Ninja CMAKE_TCH: cmake/toolchains/OSX-AppleClang-x86_64.cmake steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Install prerequisites - run: | - sw_vers - - echo && echo "** Setting up compiler" && echo - export HOMEBREW_NO_AUTO_UPDATE=1 - export HOMEBREW_NO_INSTALL_CLEANUP=1 - brew install mariadb-connector-c - - name: Report building tools - run: | - echo "Apple Clang:" && clang --version - echo "Default Linker:" && ld -v - echo && echo "CMake:" && cmake --version - echo && echo "Ninja:" && ninja --version - - - name: CMake - run: | - mkdir -p build - cmake -G "Ninja" -DCMAKE_BUILD_TYPE="Nightly" -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TCH" -S . -B ./build - - name: Ninja - run: ninja -C build -v - - name: Create package - run: | - pwd - mkdir accounts logs save scripts - zip -rj SphereSvrX-osx-x86_64-nightly.zip accounts/ logs/ save/ scripts/ src/sphere.ini src/sphereCrypt.ini build/bin-x86_64/* - - # Upload artifact linked to the workflow run - only if the run is for a pull request, or for selected branches - - name: Upload artifact - if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || ${{ github.event_name == 'pull_request' }} - uses: actions/upload-artifact@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - name: Build-osx-x86_64 - path: SphereSvrX-osx-x86_64-nightly.zip - overwrite: true - - upload_github_release: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Install prerequisites + run: | + sw_vers + echo "** Setting up compiler" + export HOMEBREW_NO_AUTO_UPDATE=1 + export HOMEBREW_NO_INSTALL_CLEANUP=1 + brew install ninja mariadb-connector-c + + - name: Report building tools + run: | + echo "Apple Clang:" && clang --version + echo "CMake:" && cmake --version + echo "Ninja:" && ninja --version + + - name: CMake + run: | + mkdir -p build + cmake -G "Ninja" \ + -DCMAKE_BUILD_TYPE="Nightly" \ + -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TCH" \ + -S . -B ./build + + - name: Ninja + run: cd build && ninja && cd .. + + - name: Create package + run: | + mkdir accounts logs save scripts + zip -rj SphereSvrX-osx-x86_64-nightly.zip accounts/ logs/ save/ scripts/ \ + src/sphere.ini src/sphereCrypt.ini build/bin-x86_64/* + + - name: Upload artifact + if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || github.event_name == 'pull_request' + uses: actions/upload-artifact@v4 + with: + name: Build-osx-x86_64 + path: SphereSvrX-osx-x86_64-nightly.zip + overwrite: true + + # -------- Release job for master/main → "Nightly" -------- + upload_github_release_main: needs: macos-x86_64 + if: contains(fromJson('["master", "main"]'), github.ref_name) + runs-on: ubuntu-latest permissions: - contents: read + contents: write actions: write - # Upload artifact linked to GitHub RELEASE we are creating - only if the run is for a pull request, or for selected branches - if: contains(fromJson('["master", "main"]'), github.ref_name) - - runs-on: ubuntu-latest steps: - name: Download builds uses: actions/download-artifact@v5 @@ -90,7 +88,7 @@ jobs: merge-multiple: true run-id: ${{ github.run_id }} - - name: Create release + - name: Upload to Nightly release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -100,14 +98,42 @@ jobs: prerelease: true files: SphereSvrX-osx-x86_64-nightly.zip + # -------- Release job for dev → "Dev Nightly" -------- + upload_github_release_dev: + needs: macos-x86_64 + if: github.ref_name == 'dev' + runs-on: ubuntu-latest + permissions: + contents: write + actions: write + + steps: + - name: Download builds + uses: actions/download-artifact@v5 + with: + name: Build-osx-x86_64 + merge-multiple: true + run-id: ${{ github.run_id }} + + - name: Upload to Dev Nightly release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: Dev Nightly + tag_name: Dev + prerelease: true + files: SphereSvrX-osx-x86_64-nightly.zip + + # -------- Self-host upload only for master/main on official repo -------- upload_selfhost_release: needs: macos-x86_64 if: contains(fromJson('["master", "main"]'), github.ref_name) && (github.repository == 'SphereServer/Source-X') + runs-on: ubuntu-latest permissions: contents: write actions: read - runs-on: ubuntu-latest steps: - name: Download builds uses: actions/download-artifact@v5 @@ -115,6 +141,7 @@ jobs: name: Build-osx-x86_64 merge-multiple: true run-id: ${{ github.run_id }} + - name: Push release run: | curl -sST "{SphereSvrX-osx-x86_64-nightly.zip}" -u ${{secrets.UP_USER}}:${{secrets.UP_PASS}} ${{secrets.UP_WHERE}} diff --git a/.github/workflows/build_win_x86.yml b/.github/workflows/build_win_x86.yml index ff9380608..e0707982b 100644 --- a/.github/workflows/build_win_x86.yml +++ b/.github/workflows/build_win_x86.yml @@ -1,17 +1,18 @@ name: Windows x86 on: + workflow_dispatch: # Allow manual trigger from GitHub Actions UI push: -# branches: -# - 'master' -# - 'main' -# - 'dev' - paths-ignore: - - '.gitignore' - - '.gitattributes' - - '**.txt' - - '**.md' - - '**.rc' + branches: + - 'master' + - 'main' + - 'dev' + paths-ignore: + - '.gitignore' + - '.gitattributes' + - '**.txt' + - '**.md' + - '**.rc' pull_request: branches: - 'master' @@ -22,47 +23,42 @@ jobs: windows-x86: runs-on: windows-latest - permissions: - contents: read - actions: read - steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - - name: CMake - run: cmake -G "Visual Studio 17 2022" -A Win32 .\ - - name: MSBuild - run: msbuild SphereServer.sln /verbosity:minimal /maxcpucount /p:Configuration=Nightly - - name: Create package - run: | - pwd - mkdir accounts, logs, save, scripts - 7z a SphereSvrX-win-x86-nightly.zip accounts\ logs\ save\ scripts\ .\bin-x86\Nightly\SphereSvrX32_nightly.exe .\src\sphere.ini .\src\sphereCrypt.ini .\lib\_bin\x86\mariadb\libmariadb.dll - - # Upload artifact linked to the workflow run - only if the run is for a pull request, or for selected branches - - name: Upload artifact - if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || ${{ github.event_name == 'pull_request' }} - uses: actions/upload-artifact@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - name: Build-win-x86 - path: SphereSvrX-win-x86-nightly.zip - overwrite: true - - upload_github_release: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: CMake + run: cmake -G "Visual Studio 17 2022" -A Win32 .\ + + - name: MSBuild + run: msbuild SphereServer.sln /verbosity:minimal /maxcpucount /p:Configuration=Nightly + + - name: Create package + run: | + pwd + mkdir accounts, logs, save, scripts + 7z a SphereSvrX-win-x86-nightly.zip accounts\ logs\ save\ scripts\ .\bin-x86\Nightly\SphereSvrX32_nightly.exe .\src\sphere.ini .\src\sphereCrypt.ini .\lib\_bin\x86\mariadb\libmariadb.dll + + # Upload artifact for later release jobs (main/master/dev or PR) + - name: Upload artifact + if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || ${{ github.event_name == 'pull_request' }} + uses: actions/upload-artifact@v4 + with: + name: Build-win-x86 + path: SphereSvrX-win-x86-nightly.zip + overwrite: true + + # Release job for master/main → goes to "Nightly" + upload_github_release_main: needs: windows-x86 - # Upload artifact linked to GitHub RELEASE we are creating - only if the run is for a pull request, or for selected branches if: contains(fromJson('["master", "main"]'), github.ref_name) - permissions: - contents: read - actions: write - runs-on: ubuntu-latest + steps: - name: Download builds uses: actions/download-artifact@v5 @@ -71,7 +67,7 @@ jobs: merge-multiple: true run-id: ${{ github.run_id }} - - name: Create release + - name: Upload to Nightly release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -81,14 +77,36 @@ jobs: prerelease: true files: SphereSvrX-win-x86-nightly.zip + # Release job for dev → goes to "Dev Nightly" + upload_github_release_dev: + needs: windows-x86 + if: github.ref_name == 'dev' + runs-on: ubuntu-latest + + steps: + - name: Download builds + uses: actions/download-artifact@v5 + with: + name: Build-win-x86 + merge-multiple: true + run-id: ${{ github.run_id }} + + - name: Upload to Dev Nightly release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: Dev Nightly + tag_name: Dev + prerelease: true + files: SphereSvrX-win-x86-nightly.zip + + # Optional self-host upload only for master/main upload_selfhost_release: needs: windows-x86 if: contains(fromJson('["master", "main"]'), github.ref_name) && (github.repository == 'SphereServer/Source-X') - permissions: - contents: write - actions: read - runs-on: ubuntu-latest + steps: - name: Download builds uses: actions/download-artifact@v5 @@ -96,6 +114,7 @@ jobs: name: Build-win-x86 merge-multiple: true run-id: ${{ github.run_id }} + - name: Push release run: | - curl -sST "{SphereSvrX-win-x86-nightly.zip}" -u ${{secrets.UP_USER}}:${{secrets.UP_PASS}} ${{secrets.UP_WHERE}} + curl -sST "{SphereSvrX-win-x86-nightly.zip}" -u ${{secrets.UP_USER}}:${{secrets.UP_PASS}} ${{secrets.UP_WHERE}} \ No newline at end of file diff --git a/.github/workflows/build_win_x86_64.yml b/.github/workflows/build_win_x86_64.yml index 65aa0b0fd..e63779853 100644 --- a/.github/workflows/build_win_x86_64.yml +++ b/.github/workflows/build_win_x86_64.yml @@ -1,17 +1,18 @@ name: Windows x86_64 on: + workflow_dispatch: # Allow manual trigger from GitHub Actions UI push: -# branches: -# - 'master' -# - 'main' -# - 'dev' - paths-ignore: - - '.gitignore' - - '.gitattributes' - - '**.txt' - - '**.md' - - '**.rc' + branches: + - 'master' + - 'main' + - 'dev' + paths-ignore: + - '.gitignore' + - '.gitattributes' + - '**.txt' + - '**.md' + - '**.rc' pull_request: branches: - 'master' @@ -26,43 +27,44 @@ jobs: actions: read steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - - name: CMake - run: cmake -G "Visual Studio 17 2022" .\ - - - name: MSBuild - run: msbuild SphereServer.sln /verbosity:minimal /maxcpucount /p:Configuration=Nightly - - name: Create package - run: | - pwd - mkdir accounts, logs, save, scripts - 7z a SphereSvrX-win-x86_64-nightly.zip accounts\ logs\ save\ scripts\ .\bin-x86_64\Nightly\SphereSvrX64_nightly.exe .\src\sphere.ini .\src\sphereCrypt.ini .\lib\_bin\x86_64\mariadb\libmariadb.dll - - # Upload artifact linked to the workflow run - only if the run is for a pull request, or for selected branches - - name: Upload artifact - if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || ${{ github.event_name == 'pull_request' }} - uses: actions/upload-artifact@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - name: Build-win-x86_64 - path: SphereSvrX-win-x86_64-nightly.zip - overwrite: true - - upload_github_release: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: CMake + run: cmake -G "Visual Studio 17 2022" .\ + + - name: MSBuild + run: msbuild SphereServer.sln /verbosity:minimal /maxcpucount /p:Configuration=Nightly + + - name: Create package + run: | + pwd + mkdir accounts, logs, save, scripts + 7z a SphereSvrX-win-x86_64-nightly.zip accounts\ logs\ save\ scripts\ .\bin-x86_64\Nightly\SphereSvrX64_nightly.exe .\src\sphere.ini .\src\sphereCrypt.ini .\lib\_bin\x86_64\mariadb\libmariadb.dll + + # Upload artifact for later release jobs (main/master/dev or PR) + - name: Upload artifact + if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || ${{ github.event_name == 'pull_request' }} + uses: actions/upload-artifact@v4 + with: + name: Build-win-x86_64 + path: SphereSvrX-win-x86_64-nightly.zip + overwrite: true + + # Release job for master/main → goes to "Nightly" + upload_github_release_main: needs: windows-x86_64 - # Upload artifact linked to GitHub RELEASE we are creating - only if the run is for a pull request, or for selected branches if: contains(fromJson('["master", "main"]'), github.ref_name) permissions: - contents: read + contents: write actions: write - runs-on: ubuntu-latest + steps: - name: Download builds uses: actions/download-artifact@v5 @@ -70,7 +72,8 @@ jobs: name: Build-win-x86_64 merge-multiple: true run-id: ${{ github.run_id }} - - name: Create release + + - name: Upload to Nightly release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -80,14 +83,43 @@ jobs: prerelease: true files: SphereSvrX-win-x86_64-nightly.zip + # Release job for dev → goes to "Dev Nightly" + upload_github_release_dev: + needs: windows-x86_64 + if: github.ref_name == 'dev' + permissions: + contents: write + actions: write + runs-on: ubuntu-latest + + steps: + - name: Download builds + uses: actions/download-artifact@v5 + with: + name: Build-win-x86_64 + merge-multiple: true + run-id: ${{ github.run_id }} + + - name: Upload to Dev Nightly release + uses: softprops/action-gh-release@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: Dev Nightly + tag_name: Dev + prerelease: true + files: SphereSvrX-win-x86_64-nightly.zip + + # Optional self-host upload only for master/main upload_selfhost_release: needs: windows-x86_64 + # Run only on master/main AND only on the official SphereServer repo if: contains(fromJson('["master", "main"]'), github.ref_name) && (github.repository == 'SphereServer/Source-X') permissions: contents: write actions: read - runs-on: ubuntu-latest + steps: - name: Download builds uses: actions/download-artifact@v5 @@ -95,6 +127,8 @@ jobs: name: Build-win-x86_64 merge-multiple: true run-id: ${{ github.run_id }} + + # Push artifact to your self-hosted endpoint - name: Push release run: | - curl -sST "{SphereSvrX-win-x86_64-nightly.zip}" -u ${{secrets.UP_USER}}:${{secrets.UP_PASS}} ${{secrets.UP_WHERE}} + curl -sST "{SphereSvrX-win-x86_64-nightly.zip}" -u ${{secrets.UP_USER}}:${{secrets.UP_PASS}} ${{secrets.UP_WHERE}} \ No newline at end of file diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index 3ba0f5bc5..f0748bd7b 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -14,6 +14,7 @@ on: jobs: latest: runs-on: ubuntu-24.04 + if: github.repository == 'SphereServer/Source-X' # Because it fail on COVERITY_TOKEN permissions: contents: read actions: read