diff --git a/.github/actions/build-linux/action.yml b/.github/actions/build-linux/action.yml new file mode 100644 index 00000000000000..1a9c9e9fd1130e --- /dev/null +++ b/.github/actions/build-linux/action.yml @@ -0,0 +1,60 @@ +name: 'build-linux-runtime' +description: 'Build Linux runtime' +inputs: + version-runtime: + description: 'Base version of the runtime (e.g. 8.0.10)' + required: true + version-patch: + description: 'Patch version (like criteo1)' + required: true + build-configuration: + description: 'Configuration to build (Debug, Release) Note the capital letter' + required: true + output-artifact-name: + description: 'Name of the artifact that will be uploaded (to be retrieved later in the workflow)' + required: true +#outputs: +# random-number: +# description: "Random number" +# value: ${{ steps.random-number-generator.outputs.random-number }} +runs: + using: "composite" + steps: + - name: Build for Linux (${{ inputs.build-configuration }}) + shell: bash + run: ./build.sh -c ${{ inputs.build-configuration }} /p:VersionSuffix=${{ inputs.version-patch }} /p:StabilizePackageVersion=false /p:OfficialBuildId=20201010.1 /p:NativeOptimizationDataSupported=false /p:SkipArchivesBuild=false + - name : Download dotnet install scripts + shell: bash + run: wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh + - name: Retrieve official ASP.Net Core runtime + shell: bash + run: | + chmod u+x ./dotnet-install.sh + mkdir -p artifacts/packages/${{ inputs.build-configuration }}/Shipping/aspnetcore-runtime + ./dotnet-install.sh --runtime aspnetcore --version ${{ inputs.version-runtime }} --os linux --install-dir artifacts/packages/${{ inputs.build-configuration }}/Shipping/aspnetcore-runtime + - name: Extract generated runtime artifact, add crossgen, symbols, and AspNetCore runtime + shell: bash + run: | + FULL_VERSION=${{ inputs.version-runtime }}-${{ inputs.version-patch }} + cd artifacts/packages/${{ inputs.build-configuration }}/Shipping + mkdir -p dotnet-runtime + cd dotnet-runtime + tar -xzvf ../dotnet-runtime-${FULL_VERSION}-linux-x64.tar.gz + cd shared/Microsoft.NETCore.App/${FULL_VERSION} + tar -xzvf ../../../../dotnet-crossgen2-${FULL_VERSION}-linux-x64.tar.gz + tar -xzvf ../../../../dotnet-runtime-symbols-linux-x64-${FULL_VERSION}.tar.gz + cd ../../../.. + cp -R aspnetcore-runtime/shared/Microsoft.AspNetCore.App dotnet-runtime/shared/Microsoft.AspNetCore.App + mv dotnet-runtime/shared/Microsoft.AspNetCore.App/${{env.RUNTIME_VERSION}} dotnet-runtime/shared/Microsoft.AspNetCore.App/${FULL_VERSION} + dotnet tool install dotnet-symbol -g + cd dotnet-runtime/shared/Microsoft.AspNetCore.App/${FULL_VERSION} + dotnet-symbol --symbols * + cd ../../../.. + sed -i "s/${{env.RUNTIME_VERSION}}/${FULL_VERSION}/g" dotnet-runtime/shared/Microsoft.AspNetCore.App/${FULL_VERSION}/Microsoft.AspNetCore.App.runtimeconfig.json + cd dotnet-runtime + tar -zcvf ../aspnetcore-runtime-${FULL_VERSION}-linux-x64.tar.gz . + - name: Upload runtime artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output-artifact-name }} + path: artifacts/packages/${{ inputs.build-configuration }}/Shipping/aspnetcore-runtime-${{ inputs.version-runtime }}-${{ inputs.version-patch }}-linux-x64.tar.gz diff --git a/.github/actions/build-windows/action.yml b/.github/actions/build-windows/action.yml new file mode 100644 index 00000000000000..85756fe88f4fbe --- /dev/null +++ b/.github/actions/build-windows/action.yml @@ -0,0 +1,26 @@ +name: 'build-windows-runtime' +description: 'Build Windos runtime' +inputs: + version-runtime: + description: 'Base version of the runtime (e.g. 8.0.10)' + required: true + version-patch: + description: 'Patch version (like criteo1)' + required: true + build-configuration: + description: 'Configuration to build (Debug, Release) Note the capital letter' + required: true + output-artifact-name: + description: 'Name of the artifact that will be uploaded (to be retrieved later in the workflow)' + required: true +runs: + using: "composite" + steps: + - name: Build for Windows (${{ inputs.build-configuration }}) + shell: powershell + run: .\build.cmd -c ${{ inputs.build-configuration }} /p:VersionSuffix=${{ inputs.version-patch }} /p:StabilizePackageVersion=false /p:OfficialBuildId=20201010.1 /p:NativeOptimizationDataSupported=false + - name: Upload runtime artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.output-artifact-name }} + path: artifacts/packages/${{ inputs.build-configuration }}/Shipping/dotnet-runtime-${{ inputs.version-runtime }}-${{ inputs.version-patch }}-win-x64.zip diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index fcfb5690dd8f66..b9fff4438a7154 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -54,13 +54,9 @@ jobs: echo runtime-version=${RUNTIME_VERSION} >> $GITHUB_OUTPUT echo runtime-patch=${RUNTIME_PATCH} >> $GITHUB_OUTPUT - build-linux: + build-linux-release: runs-on: ubuntu-latest needs: env-variables - env: - RUNTIME_VERSION: ${{needs.env-variables.outputs.runtime-version}} - RUNTIME_PATCH: ${{needs.env-variables.outputs.runtime-patch}} - CODE_VERSION: ${{needs.env-variables.outputs.code-version}} container: image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8 steps: @@ -68,37 +64,33 @@ jobs: uses: actions/checkout@v4 with: ref: ${{env.CODE_VERSION}} - - name: Build for Linux - run: ./build.sh -c Release /p:VersionSuffix=${{env.RUNTIME_PATCH}} /p:StabilizePackageVersion=false /p:OfficialBuildId=20201010.1 /p:NativeOptimizationDataSupported=false - - name : Download dotnet install scripts - run: wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh - - name: Retrieve official ASP.Net Core runtime - run: | - chmod u+x ./dotnet-install.sh - mkdir -p artifacts/packages/Release/Shipping/aspnetcore-runtime - ./dotnet-install.sh --runtime aspnetcore --version ${{env.RUNTIME_VERSION}} --os linux --install-dir artifacts/packages/Release/Shipping/aspnetcore-runtime - - name: Extract generated runtime artifact, add crossgen, symbols, and AspNetCore runtime - run: | - FULL_VERSION=${{env.RUNTIME_VERSION}}-${{env.RUNTIME_PATCH}} - cd artifacts/packages/Release/Shipping - mkdir -p dotnet-runtime - cd dotnet-runtime - tar -xzvf ../dotnet-runtime-${FULL_VERSION}-linux-x64.tar.gz - cd shared/Microsoft.NETCore.App/${FULL_VERSION} - tar -xzvf ../../../../dotnet-crossgen2-${FULL_VERSION}-linux-x64.tar.gz - tar -xzvf ../../../../dotnet-nethost-symbols-linux-x64-${FULL_VERSION}.tar.gz - cd ../../../.. - cp -R aspnetcore-runtime/shared/Microsoft.AspNetCore.App dotnet-runtime/shared/Microsoft.AspNetCore.App - mv dotnet-runtime/shared/Microsoft.AspNetCore.App/${{env.RUNTIME_VERSION}} dotnet-runtime/shared/Microsoft.AspNetCore.App/${FULL_VERSION} - sed -i "s/${{env.RUNTIME_VERSION}}/${FULL_VERSION}/g" dotnet-runtime/shared/Microsoft.AspNetCore.App/${FULL_VERSION}/Microsoft.AspNetCore.App.runtimeconfig.json - cd dotnet-runtime - tar -zcvf ../aspnetcore-runtime-${FULL_VERSION}-linux-x64.tar.gz . - - name: Upload runtime artifact - uses: actions/upload-artifact@v4 + - name: Build + uses: ./.github/actions/build-linux with: - name: linux-runtime - path: artifacts/packages/Release/Shipping/aspnetcore-runtime-${{env.RUNTIME_VERSION}}-${{env.RUNTIME_PATCH}}-linux-x64.tar.gz - build-windows: + version-runtime: ${{needs.env-variables.outputs.runtime-version}} + version-patch: ${{needs.env-variables.outputs.runtime-patch}} + build-configuration: Release + output-artifact-name: 'linux-runtime-release' + build-linux-debug: + runs-on: ubuntu-latest + needs: env-variables + container: + image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8 + steps: + - name: Check out runtime source code + uses: actions/checkout@v4 + with: + ref: ${{env.CODE_VERSION}} + - name: Build + uses: ./.github/actions/build-linux + with: + version-runtime: ${{needs.env-variables.outputs.runtime-version}} + version-patch: ${{needs.env-variables.outputs.runtime-patch}} + build-configuration: Debug + output-artifact-name: 'linux-runtime-debug' + + + build-windows-debug: runs-on: windows-latest needs: env-variables steps: @@ -106,13 +98,28 @@ jobs: uses: actions/checkout@v4 with: ref: ${{env.CODE_VERSION}} - - name: Build CLR for Windows - run: .\build.cmd clr -c Release /p:OfficialBuildId=20201010.1 - - name: Upload mscordaccore artifact - uses: actions/upload-artifact@v4 + - name: Build + uses: ./.github/actions/build-windows with: - name: mscordaccore.dll - path: artifacts/bin/coreclr/Linux.x64.Release/x64/mscordaccore.dll + version-runtime: ${{needs.env-variables.outputs.runtime-version}} + version-patch: ${{needs.env-variables.outputs.runtime-patch}} + build-configuration: Debug + output-artifact-name: 'windows-runtime-debug' + build-windows-release: + runs-on: windows-latest + needs: env-variables + steps: + - name: Check out runtime source code + uses: actions/checkout@v4 + with: + ref: ${{env.CODE_VERSION}} + - name: Build + uses: ./.github/actions/build-windows + with: + version-runtime: ${{needs.env-variables.outputs.runtime-version}} + version-patch: ${{needs.env-variables.outputs.runtime-patch}} + build-configuration: Release + output-artifact-name: 'windows-runtime-release' package-and-release: runs-on: ubuntu-latest if: needs.env-variables.outputs.runtime-patch != 'dev' @@ -121,8 +128,10 @@ jobs: RUNTIME_PATCH: ${{needs.env-variables.outputs.runtime-patch}} needs: - env-variables - - build-linux - - build-windows + - build-linux-debug + - build-linux-release + - build-windows-debug + - build-windows-release steps: - name: Download .Net runtime artifact uses: actions/download-artifact@v4