Fix swapping non empty bags. #14
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
| # Build and publish the development release on pushes to development. | |
| name: Development Release | |
| on: | |
| push: | |
| branches: | |
| - development | |
| paths-ignore: | |
| - '.github/ISSUE_TEMPLATE.md' | |
| - '.github/ISSUE_TEMPLATE/**' | |
| - '.github/PULL_REQUEST_TEMPLATE.md' | |
| - '.github/workflows/development-db-dump.yaml' | |
| - '.github/workflows/pr-sql-check.yaml' | |
| - '.gitignore' | |
| - 'CONTRIBUTING.md' | |
| - 'LICENSE' | |
| - 'README.md' | |
| - 'sql/**' | |
| concurrency: | |
| group: development-release-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-linux: | |
| name: Build Linux development release | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Install Ubuntu build dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y --no-install-recommends \ | |
| build-essential \ | |
| cmake \ | |
| libmysqlclient-dev \ | |
| libssl-dev \ | |
| patchelf \ | |
| zlib1g-dev | |
| - name: Build release binaries | |
| run: | | |
| set -euo pipefail | |
| mkdir -p build _install | |
| cd build | |
| cmake ../ \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/_install" \ | |
| -DBUILD_EXTRACTORS=1 \ | |
| -DBUILD_FOR_HOST_CPU=0 \ | |
| -DCONF_DIR:STRING=./etc \ | |
| -DDEBUG_SYMBOLS=0 | |
| make -j"$(nproc)" | |
| make install | |
| - name: Set release archive filename | |
| run: | | |
| echo "ARCHIVE_FILENAME=dev-linux-amd64-$(git rev-parse --short HEAD).tar.gz" >>"$GITHUB_ENV" | |
| - name: Create release archive | |
| run: | | |
| set -euo pipefail | |
| ./.github/scripts/package-linux-release.sh _install "$ARCHIVE_FILENAME" | |
| - name: Smoke test release | |
| run: | | |
| set -euo pipefail | |
| cat >smoke-test-linux-release.sh <<'SMOKE_TEST' | |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| mkdir -p /tmp/vmangos-release | |
| tar -xzf /tmp/release.tar.gz -C /tmp/vmangos-release | |
| /tmp/vmangos-release/vmangos-linux-amd64/bin/realmd --version | |
| /tmp/vmangos-release/vmangos-linux-amd64/bin/mangosd --version | |
| while IFS= read -r -d '' file; do | |
| magic="$(head -c 4 "$file" 2>/dev/null || true)" | |
| if [ "$magic" = $'\177ELF' ]; then | |
| ldd "$file" | |
| fi | |
| done < <(find /tmp/vmangos-release/vmangos-linux-amd64 -type f -print0) >/tmp/ldd-output.txt | |
| if grep -q "not found" /tmp/ldd-output.txt; then | |
| cat /tmp/ldd-output.txt | |
| exit 1 | |
| fi | |
| SMOKE_TEST | |
| docker run --rm --platform linux/amd64 \ | |
| -v "$GITHUB_WORKSPACE/bin/$ARCHIVE_FILENAME:/tmp/release.tar.gz:ro" \ | |
| -v "$PWD/smoke-test-linux-release.sh:/tmp/smoke-test-linux-release.sh:ro" \ | |
| ubuntu:24.04 \ | |
| bash /tmp/smoke-test-linux-release.sh | |
| - name: Upload release artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: linux-development-build | |
| path: "${{ github.workspace }}/bin/${{ env.ARCHIVE_FILENAME }}" | |
| build-windows: | |
| name: Build Windows development release | |
| runs-on: windows-2022 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| - name: Build release binaries | |
| shell: bash # Windows runners default to PowerShell. | |
| run: | | |
| set -euo pipefail | |
| mkdir -p build | |
| cd build | |
| cmake ../ \ | |
| -DBUILD_EXTRACTORS=1 \ | |
| -DBUILD_WARNINGS_AS_ERROR=1 \ | |
| -G "Visual Studio 17 2022" \ | |
| -A x64 | |
| "/c/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" "MaNGOS.sln" //p:Platform=x64 //p:Configuration=Release //m | |
| - name: Set release archive filename | |
| run: | | |
| echo "ARCHIVE_FILENAME=dev-windows-amd64-$(git rev-parse --short HEAD).zip" >> $env:GITHUB_ENV | |
| - name: Create release archive | |
| shell: bash # Windows runners default to PowerShell. | |
| run: | | |
| set -euo pipefail | |
| ./.github/scripts/package-windows-release.sh x64 "$ARCHIVE_FILENAME" | |
| - name: Upload release artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: windows-development-build | |
| path: "${{ github.workspace }}/bin/${{ env.ARCHIVE_FILENAME }}" | |
| publish: | |
| name: Publish development release | |
| needs: [build-linux, build-windows] | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download Linux release artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: linux-development-build | |
| path: release-assets | |
| - name: Download Windows release artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: windows-development-build | |
| path: release-assets | |
| - name: Write release notes preamble | |
| run: | | |
| cat >release-notes.md <<'RELEASE_NOTES' | |
| ## Linux compatibility | |
| The Linux build is for `amd64` systems using `glibc` 2.39 or newer. | |
| It is built on Ubuntu 24.04 and bundles non-`glibc` runtime libraries. | |
| It is not expected to run on Alpine/`musl` or older `glibc` systems. | |
| RELEASE_NOTES | |
| - name: Publish release snapshot | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: ./.github/scripts/publish-moving-release.sh latest "Development Build" release-assets release-notes.md |