diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4c670c..3e7dded 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: uses: actions/setup-dotnet@v6 - name: Build - run: dotnet publish DepotDownloader/DepotDownloader.csproj -c ${{ matrix.configuration }} -o artifacts /p:ContinuousIntegrationBuild=true + run: dotnet publish DepotDownloader/DepotDownloader.csproj -c ${{ matrix.configuration }} -o artifacts - name: Upload artifact uses: actions/upload-artifact@v7 @@ -43,31 +43,19 @@ jobs: - name: Publish Windows-x64 if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest' - run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-x64 --output selfcontained-win-x64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release --runtime win-x64 -p:PublishAot=true --output selfcontained-win-x64 - name: Publish Windows-arm64 if: matrix.configuration == 'Release' && matrix.runs-on == 'windows-latest' - run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime win-arm64 --output selfcontained-win-arm64 - - - name: Publish Linux-x64 - if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest' - run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-x64 --output selfcontained-linux-x64 - - - name: Publish Linux-arm - if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest' - run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-arm --output selfcontained-linux-arm - - - name: Publish Linux-arm64 - if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest' - run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime linux-arm64 --output selfcontained-linux-arm64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release --runtime win-arm64 -p:PublishAot=true --output selfcontained-win-arm64 - name: Publish macOS-x64 if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-latest' - run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime osx-x64 --output selfcontained-osx-x64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release --runtime osx-x64 -p:PublishAot=true --output selfcontained-osx-x64 - name: Publish macOS-arm64 if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-14' - run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release -p:PublishSingleFile=true -p:DebugType=embedded --self-contained --runtime osx-arm64 --output selfcontained-osx-arm64 + run: dotnet publish DepotDownloader/DepotDownloader.csproj --configuration Release --runtime osx-arm64 -p:PublishAot=true --output selfcontained-osx-arm64 - name: Upload Windows-x64 uses: actions/upload-artifact@v7 @@ -85,36 +73,14 @@ jobs: path: selfcontained-win-arm64 if-no-files-found: error - - name: Upload Linux-x64 - uses: actions/upload-artifact@v7 - if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest' - with: - name: DepotDownloader-linux-x64 - path: selfcontained-linux-x64 - if-no-files-found: error - - - name: Upload Linux-arm - uses: actions/upload-artifact@v7 - if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest' - with: - name: DepotDownloader-linux-arm - path: selfcontained-linux-arm - if-no-files-found: error - - - name: Upload Linux-arm64 - uses: actions/upload-artifact@v7 - if: matrix.configuration == 'Release' && matrix.runs-on == 'ubuntu-latest' - with: - name: DepotDownloader-linux-arm64 - path: selfcontained-linux-arm64 - if-no-files-found: error - - name: Upload macOS-x64 uses: actions/upload-artifact@v7 if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-latest' with: name: DepotDownloader-macos-x64 - path: selfcontained-osx-x64 + path: | + selfcontained-osx-x64 + !selfcontained-osx-x64/*.dSYM if-no-files-found: error - name: Upload macOS-arm64 @@ -122,12 +88,48 @@ jobs: if: matrix.configuration == 'Release' && matrix.runs-on == 'macos-14' with: name: DepotDownloader-macos-arm64 - path: selfcontained-osx-arm64 + path: | + selfcontained-osx-arm64 + !selfcontained-osx-arm64/*.dSYM + if-no-files-found: error + + linux-cross-compile: + name: NativeAOT ${{ matrix.rid }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - { rid: linux-x64, image: amd64, rootfs: x64 } + - { rid: linux-arm64, image: arm64, rootfs: arm64 } + - { rid: linux-arm, image: arm, rootfs: arm } + - { rid: linux-musl-x64, image: amd64-musl, rootfs: x64 } + - { rid: linux-musl-arm64, image: arm64-musl, rootfs: arm64 } + container: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-cross-${{ matrix.image }} + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 + steps: + - uses: actions/checkout@v7 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v6 + + - name: Publish ${{ matrix.rid }} + run: dotnet publish DepotDownloader/DepotDownloader.csproj -c Release -r ${{ matrix.rid }} -p:PublishAot=true -p:SysRoot=/crossrootfs/${{ matrix.rootfs }} -p:LinkerFlavor=lld -p:ObjCopyName=llvm-objcopy -o selfcontained-${{ matrix.rid }} + + - name: Upload ${{ matrix.rid }} + uses: actions/upload-artifact@v7 + with: + name: DepotDownloader-${{ matrix.rid }} + path: selfcontained-${{ matrix.rid }} if-no-files-found: error release: if: startsWith(github.ref, 'refs/tags/') - needs: build + needs: + - build + - linux-cross-compile runs-on: ubuntu-latest steps: - name: Download artifacts @@ -146,6 +148,8 @@ jobs: chmod +x artifacts/DepotDownloader-linux-x64/DepotDownloader chmod +x artifacts/DepotDownloader-linux-arm/DepotDownloader chmod +x artifacts/DepotDownloader-linux-arm64/DepotDownloader + chmod +x artifacts/DepotDownloader-linux-musl-x64/DepotDownloader + chmod +x artifacts/DepotDownloader-linux-musl-arm64/DepotDownloader chmod +x artifacts/DepotDownloader-macos-x64/DepotDownloader chmod +x artifacts/DepotDownloader-macos-arm64/DepotDownloader zip -9j release/DepotDownloader-framework.zip artifacts/DepotDownloader-framework/* @@ -154,6 +158,8 @@ jobs: zip -9j release/DepotDownloader-linux-x64.zip artifacts/DepotDownloader-linux-x64/* zip -9j release/DepotDownloader-linux-arm.zip artifacts/DepotDownloader-linux-arm/* zip -9j release/DepotDownloader-linux-arm64.zip artifacts/DepotDownloader-linux-arm64/* + zip -9j release/DepotDownloader-linux-musl-x64.zip artifacts/DepotDownloader-linux-musl-x64/* + zip -9j release/DepotDownloader-linux-musl-arm64.zip artifacts/DepotDownloader-linux-musl-arm64/* zip -9j release/DepotDownloader-macos-x64.zip artifacts/DepotDownloader-macos-x64/* zip -9j release/DepotDownloader-macos-arm64.zip artifacts/DepotDownloader-macos-arm64/* diff --git a/DepotDownloader/DepotDownloader.csproj b/DepotDownloader/DepotDownloader.csproj index fed6198..79f0557 100644 --- a/DepotDownloader/DepotDownloader.csproj +++ b/DepotDownloader/DepotDownloader.csproj @@ -10,10 +10,23 @@ Copyright © SteamRE Team 2025 ..\Icon\DepotDownloader.ico true + true true true + + Size + true + false + false + false + false + none + false + $(NoWarn);IL2104;IL3053 + + Always