diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a499ff841..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build Minecraft Legacy Console Edition -on: - workflow_dispatch: - -jobs: - build: - runs-on: windows-2022 - - strategy: - matrix: - configuration: [Release, Debug] - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - - - name: Build Minecraft Legacy Console Edition - run: | - msbuild MinecraftConsoles.sln ` - /p:Configuration=${{ matrix.configuration }} ` - /p:Platform=Windows64 ` - /m - - - name: Upload Release + Debug Artifacts - uses: actions/upload-artifact@v4 - with: - name: MinecraftClient-${{ matrix.configuration }} - path: x64/${{ matrix.configuration }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f3b6dbc89..f74070714 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,23 +12,58 @@ on: jobs: build: - name: Build Windows64 runs-on: windows-latest + strategy: + matrix: + platform: [Windows64] + steps: - name: Checkout uses: actions/checkout@v6 - - name: Setup msbuild + - name: Set platform lowercase + run: echo "PLATFORM=$('${{ matrix.platform }}'.ToLower())" >> $env:GITHUB_ENV + + - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - name: Configure - run: cmake -B out/build --preset windows64 + run: cmake -B out/build/${{ env.PLATFORM }} --preset ${{ env.PLATFORM }} + - name: Build - run: cmake --build out/build --preset windows64-release --target Minecraft.Client + run: cmake --build out/build/${{ env.PLATFORM }} --preset ${{ env.PLATFORM }}-release --target Minecraft.Client - name: Zip Build - run: 7z a -r LCEWindows64.zip ./out/build/Minecraft.Client/Release/* + run: 7z a -r LCE${{ matrix.platform }}.zip ./out/build/${{ env.PLATFORM }}/Minecraft.Client/Release/* + + - name: Stage artifacts + run: | + New-Item -ItemType Directory -Force -Path staging + Copy-Item LCE${{ matrix.platform }}.zip staging/ + + - name: Stage exe and pdb + if: matrix.platform == 'Windows64' + run: | + Copy-Item ./out/build/${{ env.PLATFORM }}/Minecraft.Client/Release/Minecraft.Client.exe staging/ + Copy-Item ./out/build/${{ env.PLATFORM }}/Minecraft.Client/Release/Minecraft.Client.pdb staging/ + + - name: Upload artifacts + uses: actions/upload-artifact@v6 + with: + name: build-${{ matrix.platform }} + path: staging/* + + release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v7 + with: + path: artifacts + merge-multiple: true - name: Update release uses: andelf/nightly-release@main @@ -43,6 +78,9 @@ jobs: # 🚨 First time here? 🚨 If you've never downloaded the game before, you need to download `LCEWindows64.zip` and extract it to the folder where you'd like to keep the game. The other files are included in this `.zip` file! files: | - LCEWindows64.zip - ./out/build/Minecraft.Client/Release/Minecraft.Client.exe - ./out/build/Minecraft.Client/Release/Minecraft.Client.pdb + artifacts/* + + - name: Cleanup artifacts + uses: geekyeggo/delete-artifact@v5 + with: + name: build-* diff --git a/.github/workflows/debug-test.yml b/.github/workflows/pull-request.yml similarity index 53% rename from .github/workflows/debug-test.yml rename to .github/workflows/pull-request.yml index 4acd5fc5b..962023284 100644 --- a/.github/workflows/debug-test.yml +++ b/.github/workflows/pull-request.yml @@ -1,4 +1,4 @@ -name: MSBuild Debug Test +name: Pull Request Build on: workflow_dispatch: @@ -8,25 +8,22 @@ on: - '.gitignore' - '*.md' - '.github/*.md' - push: - branches: - - 'main' - paths-ignore: - - '.gitignore' - - '*.md' - - '.github/*.md' jobs: build: - name: Build Windows64 (DEBUG) runs-on: windows-latest - + steps: - name: Checkout uses: actions/checkout@v6 - - name: Setup msbuild + - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 + - name: Configure + run: cmake -B out/build/windows64 --preset windows64 + - name: Build - run: MSBuild.exe MinecraftConsoles.sln /p:Configuration=Debug /p:Platform="Windows64" + run: cmake --build out/build/windows64 --preset windows64-debug --target Minecraft.Client + +