name: Stable Release on: push: paths: - 'BUMP' #neo: this is a file. edit it. contains version number #neo: DO NOT ADD NOTES.md HERE. workflow_dispatch: permissions: contents: write id-token: write attestations: write concurrency: group: stable cancel-in-progress: true jobs: build-client: name: Build Client runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v6 with: submodules: recursive - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - name: Setup CMake uses: lukka/get-cmake@latest - name: Run CMake uses: lukka/run-cmake@v10 env: VCPKG_ROOT: "" with: configurePreset: windows64 buildPreset: windows64-release buildPresetAdditionalArgs: "['--target', 'Minecraft.Client']" - name: Zip Build shell: pwsh run: | $source = "./build/windows64/Minecraft.Client/Release" $zip = "neoLegacyWindows64.zip" $topLevel = "neoLegacyWindows64" # Collect files, excluding unwanted extensions $files = Get-ChildItem -Path $source -Recurse -File | Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj' } Add-Type -AssemblyName System.IO.Compression Add-Type -AssemblyName System.IO.Compression.FileSystem $basePath = (Resolve-Path $source).Path $fs = [System.IO.File]::Open($zip, [System.IO.FileMode]::Create) try { $archive = New-Object System.IO.Compression.ZipArchive($fs, [System.IO.Compression.ZipArchiveMode]::Create) try { # Add directories Get-ChildItem -Path $basePath -Recurse -Directory | ForEach-Object { $rel = $_.FullName.Substring($basePath.Length).TrimStart('\', '/') $archive.CreateEntry("$topLevel/$($rel -replace '\\','/')/") | Out-Null } # Add files foreach ($file in $files) { $rel = $file.FullName.Substring($basePath.Length).TrimStart('\', '/') $entryName = "$topLevel/$($rel -replace '\\','/')" [System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile( $archive, $file.FullName, $entryName, [System.IO.Compression.CompressionLevel]::Optimal ) | Out-Null } } finally { $archive.Dispose() } } finally { $fs.Dispose() } Write-Host "Created $zip" - name: Stage artifacts shell: pwsh run: | New-Item -ItemType Directory -Force -Path staging Copy-Item neoLegacyWindows64.zip staging/ - name: Upload artifacts uses: actions/upload-artifact@v6 with: name: client-build path: staging/* build-server: name: Build Server runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v6 with: submodules: recursive - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 - name: Setup CMake uses: lukka/get-cmake@latest - name: Setup .NET uses: actions/setup-dotnet@v4 with: global-json-file: global.json - name: Run CMake uses: lukka/run-cmake@v10 env: VCPKG_ROOT: "" with: configurePreset: windows64 buildPreset: windows64-release buildPresetAdditionalArgs: "['--target', 'Minecraft.Server', '--target', 'Minecraft.Server.FourKit']" - name: Zip Build (vanilla) shell: pwsh run: | $source = "./build/windows64/Minecraft.Server/Release" $zip = "neoLegacyServerWindows64.zip" $topLevel = "neoLegacyServerWindows64" $files = Get-ChildItem -Path $source -Recurse -File | Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj' } Add-Type -AssemblyName System.IO.Compression Add-Type -AssemblyName System.IO.Compression.FileSystem $basePath = (Resolve-Path $source).Path $fs = [System.IO.File]::Open($zip, [System.IO.FileMode]::Create) try { $archive = New-Object System.IO.Compression.ZipArchive($fs, [System.IO.Compression.ZipArchiveMode]::Create) try { Get-ChildItem -Path $basePath -Recurse -Directory | ForEach-Object { $rel = $_.FullName.Substring($basePath.Length).TrimStart('\', '/') $archive.CreateEntry("$topLevel/$($rel -replace '\\','/')/") | Out-Null } foreach ($file in $files) { $rel = $file.FullName.Substring($basePath.Length).TrimStart('\', '/') $entryName = "$topLevel/$($rel -replace '\\','/')" [System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile( $archive, $file.FullName, $entryName, [System.IO.Compression.CompressionLevel]::Optimal ) | Out-Null } } finally { $archive.Dispose() } } finally { $fs.Dispose() } Write-Host "Created $zip" - name: Zip Build (FourKit) shell: pwsh run: | $source = "./build/windows64/Minecraft.Server.FourKit/Release" $zip = "neoLegacyServerWindows64-FourKit.zip" $topLevel = "neoLegacyServerWindows64-FourKit" $files = Get-ChildItem -Path $source -Recurse -File | Where-Object { $_.Extension -notin '.pch', '.zip', '.ipdb', '.iobj' } Add-Type -AssemblyName System.IO.Compression Add-Type -AssemblyName System.IO.Compression.FileSystem $basePath = (Resolve-Path $source).Path $fs = [System.IO.File]::Open($zip, [System.IO.FileMode]::Create) try { $archive = New-Object System.IO.Compression.ZipArchive($fs, [System.IO.Compression.ZipArchiveMode]::Create) try { Get-ChildItem -Path $basePath -Recurse -Directory | ForEach-Object { $rel = $_.FullName.Substring($basePath.Length).TrimStart('\', '/') $archive.CreateEntry("$topLevel/$($rel -replace '\\','/')/") | Out-Null } foreach ($file in $files) { $rel = $file.FullName.Substring($basePath.Length).TrimStart('\', '/') $entryName = "$topLevel/$($rel -replace '\\','/')" [System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile( $archive, $file.FullName, $entryName, [System.IO.Compression.CompressionLevel]::Optimal ) | Out-Null } } finally { $archive.Dispose() } } finally { $fs.Dispose() } Write-Host "Created $zip" - name: Stage artifacts shell: pwsh run: | New-Item -ItemType Directory -Force -Path staging Copy-Item neoLegacyServerWindows64.zip staging/ Copy-Item neoLegacyServerWindows64-FourKit.zip staging/ - name: Upload artifacts uses: actions/upload-artifact@v6 with: name: server-build path: staging/* release-server: name: Release Server needs: build-server runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 - name: Download server artifacts uses: actions/download-artifact@v7 with: name: server-build path: artifacts - name: Attest artifacts uses: actions/attest-build-provenance@v2 with: subject-path: | artifacts/neoLegacyServerWindows64.zip artifacts/neoLegacyServerWindows64-FourKit.zip - name: Create tag run: | VERSION=v$(cat BUMP) git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git tag -f $VERSION-Dedicated-Server -m "$VERSION server" git push origin $VERSION-Dedicated-Server --force - name: Create release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | VERSION=v$(cat BUMP) gh release create $VERSION-Dedicated-Server artifacts/* \ --title "$VERSION Server" \ --notes "Dedicated Server runtime for Windows64. Two flavours are attached: - \`neoLegacyServerWindows64.zip\`: vanilla server, no plugin support, smallest download. - \`neoLegacyServerWindows64-FourKit.zip\`: server with the FourKit plugin host, bundled .NET 10 runtime, and an empty \`plugins/\` folder ready for plugin authors to drop DLLs into. Pick the flavour you want and extract it to a folder where you'd like to keep the server runtime." \ --latest=false release-client: name: Release Client needs: [build-client, release-server] runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 - name: Download client artifacts uses: actions/download-artifact@v7 with: name: client-build path: artifacts - name: Attest artifacts uses: actions/attest-build-provenance@v2 with: subject-path: | artifacts/neoLegacyWindows64.zip - name: Create tag run: | VERSION=v$(cat BUMP) git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git tag -f $VERSION -m "Stable release $VERSION" git push origin $VERSION --force - name: Create release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | VERSION=v$(cat BUMP) gh release create $VERSION artifacts/* \ --title "$VERSION" \ --notes-file NOTES.md cleanup: needs: [release-client, release-server] if: always() runs-on: ubuntu-latest steps: - name: Cleanup artifacts uses: geekyeggo/delete-artifact@v5 with: name: | client-build server-build