From 67ac28b85c37e9967b63933be011fec5aed1c4cc Mon Sep 17 00:00:00 2001 From: Christopher Homberger Date: Mon, 6 Jan 2025 20:06:19 +0100 Subject: [PATCH 1/3] continue to publish .net6 to nuget under lower revision * Use LegacyRunner for normal builds again * keep using new mode for single file * .net6 .6 revision * .net8 .8 revision --- .github/workflows/build-publish.yml | 25 ++++++++++++++----------- .github/workflows/nuget.yml | 26 ++++++++++++-------------- src/Runner.Client/Program.cs | 2 +- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index fe64de2114a..c3461a1adc4 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -87,26 +87,23 @@ jobs: - uses: actions/setup-dotnet@v4 with: dotnet-version: '8.0.x' + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '6.0.x' - name: GenerateConstant run: dotnet msbuild ./dir.proj -t:GenerateConstant -p:RunnerVersion=${{ inputs.version }} -p:PackageRuntime=any shell: pwsh working-directory: ./src - - name: Restore - run: dotnet restore -p:RuntimeFrameworkVersion=8.0.0 - shell: pwsh - working-directory: ./src/Runner.Client - - name: Build - run: dotnet build --no-restore -c Release -p:BUILD_OS=Any -p:Version=${{ inputs.version }} -p:RuntimeFrameworkVersion=8.0.0 - shell: pwsh - working-directory: ./src/Runner.Client - name: Pack run: | - dotnet pack --no-restore -c Release --no-build -p:Version=${{ inputs.version }} -p:RuntimeFrameworkVersion=8.0.0 -p:CHANGELOG_URL=https://github.com/ChristopherHX/runner.server/releases/tag/v${{ inputs.version }} - dotnet pack --no-restore -c Release --no-build -p:Version=${{ inputs.version }} -p:RuntimeFrameworkVersion=8.0.0 -p:CHANGELOG_URL=https://github.com/ChristopherHX/runner.server/releases/tag/v${{ inputs.version }} /p:LegacyDotnetTool=1 + dotnet pack -c Release -p:BUILD_OS=Any -p:Version=${{ inputs.version }}.6 -p:RuntimeFrameworkVersion=6.0.0 -p:CHANGELOG_URL=https://github.com/ChristopherHX/runner.server/releases/tag/v${{ inputs.version }} + dotnet pack -c Release -p:BUILD_OS=Any -p:Version=${{ inputs.version }}.6 -p:RuntimeFrameworkVersion=6.0.0 -p:CHANGELOG_URL=https://github.com/ChristopherHX/runner.server/releases/tag/v${{ inputs.version }} /p:LegacyDotnetTool=1 + dotnet pack -c Release -p:BUILD_OS=Any -p:Version=${{ inputs.version }}.8 -p:RuntimeFrameworkVersion=8.0.0 -p:CHANGELOG_URL=https://github.com/ChristopherHX/runner.server/releases/tag/v${{ inputs.version }} + dotnet pack -c Release -p:BUILD_OS=Any -p:Version=${{ inputs.version }}.8 -p:RuntimeFrameworkVersion=8.0.0 -p:CHANGELOG_URL=https://github.com/ChristopherHX/runner.server/releases/tag/v${{ inputs.version }} /p:LegacyDotnetTool=1 shell: pwsh working-directory: ./src/Runner.Client - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: nupkg path: src/Runner.Client/nupkg @@ -117,3 +114,9 @@ jobs: working-directory: ./src/Runner.Client/nupkg env: GHARUN: ${{secrets.GHARUN}} + - name: Push to GitHub Packages + if: ${{ github.server_url == 'https://github.com' }} + run: | + dotnet nuget push ./*.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --no-symbols + working-directory: ./src/Runner.Client/nupkg + continue-on-error: true diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index cbfe8500303..21d00f29e33 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -16,36 +16,34 @@ jobs: version: ${{ steps.build.outputs.version }} steps: - uses: actions/checkout@v3 + - run: npm install -g semver - uses: actions/setup-dotnet@v3 with: dotnet-version: '8.0.x' + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: '6.0.x' - name: GenerateConstant run: dotnet msbuild ./dir.proj -t:GenerateConstant /p:RunnerVersion=$(Get-Content ./runnerversion) /p:PackageRuntime=any shell: pwsh working-directory: ./src - - name: Restore - run: dotnet restore /p:RuntimeFrameworkVersion=8.0.0 - shell: pwsh - working-directory: ./src/Runner.Client - - name: Build + - name: Pack id: build run: | $d = Get-Date - $version = $("$(gh release view --repo ${{ github.server_url }}/${{ github.repository }} --json tagName -t "{{.tagName}}")".TrimStart("v") + "-preview." + $d.Year + "." + $d.Month + "." + $d.Day + "." + $d.Hour + "." + $d.Minute + "." + $d.Second + "." + $ENV:GITHUB_RUN_ID) - dotnet build --no-restore -c Release /p:BUILD_OS=Any /p:Version=$version /p:RuntimeFrameworkVersion=8.0.0 + $version6 = $("$(semver "$(gh release view --repo ${{ github.server_url }}/${{ github.repository }} --json tagName -t "{{.tagName}}")" -i patch)".TrimStart("v") + ".6-preview." + $d.Year + "." + $d.Month + "." + $d.Day + "." + $d.Hour + "." + $d.Minute + "." + $d.Second + "." + $ENV:GITHUB_RUN_ID) + $version = $("$(semver "$(gh release view --repo ${{ github.server_url }}/${{ github.repository }} --json tagName -t "{{.tagName}}")" -i patch)".TrimStart("v") + ".8-preview." + $d.Year + "." + $d.Month + "." + $d.Day + "." + $d.Hour + "." + $d.Minute + "." + $d.Second + "." + $ENV:GITHUB_RUN_ID) + dotnet pack -c Release /p:Version=$version6 /p:RuntimeFrameworkVersion=6.0.0 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} + dotnet pack -c Release /p:Version=$version6 /p:RuntimeFrameworkVersion=6.0.0 /p:LegacyDotnetTool=1 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} + dotnet pack -c Release /p:Version=$version /p:RuntimeFrameworkVersion=8.0.0 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} + dotnet pack -c Release /p:Version=$version /p:RuntimeFrameworkVersion=8.0.0 /p:LegacyDotnetTool=1 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} echo "version=$version" > $env:GITHUB_OUTPUT shell: pwsh working-directory: ./src/Runner.Client env: GH_TOKEN: ${{ github.token }} - - name: Pack - run: | - dotnet pack --no-restore -c Release --no-build /p:Version=${{steps.build.outputs.version}} /p:RuntimeFrameworkVersion=8.0.0 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} - dotnet pack --no-restore -c Release --no-build /p:Version=${{steps.build.outputs.version}} /p:RuntimeFrameworkVersion=8.0.0 /p:LegacyDotnetTool=1 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} - shell: pwsh - working-directory: ./src/Runner.Client - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: nupkg path: src/Runner.Client/nupkg diff --git a/src/Runner.Client/Program.cs b/src/Runner.Client/Program.cs index 861d3ec7916..15b98bce300 100644 --- a/src/Runner.Client/Program.cs +++ b/src/Runner.Client/Program.cs @@ -1325,7 +1325,7 @@ static int Main(string[] args) if(Environment.GetEnvironmentVariable("RUNNER_CLIENT_LEGACY_SERVER") == "1") { parameters.LegacyServer = true; } - if(Environment.GetEnvironmentVariable("RUNNER_CLIENT_LEGACY_RUNNER") == "1") { + if((Environment.GetEnvironmentVariable("RUNNER_CLIENT_LEGACY_RUNNER") ?? (string.IsNullOrWhiteSpace(Assembly.GetEntryAssembly().Location) ? null : "1")) == "1") { parameters.LegacyRunner = true; } From 45283300962320822ce1b769845b56885969a199 Mon Sep 17 00:00:00 2001 From: Christopher Homberger Date: Mon, 6 Jan 2025 20:09:26 +0100 Subject: [PATCH 2/3] . --- .github/workflows/nuget.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 21d00f29e33..1dc900b2de0 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -33,10 +33,10 @@ jobs: $d = Get-Date $version6 = $("$(semver "$(gh release view --repo ${{ github.server_url }}/${{ github.repository }} --json tagName -t "{{.tagName}}")" -i patch)".TrimStart("v") + ".6-preview." + $d.Year + "." + $d.Month + "." + $d.Day + "." + $d.Hour + "." + $d.Minute + "." + $d.Second + "." + $ENV:GITHUB_RUN_ID) $version = $("$(semver "$(gh release view --repo ${{ github.server_url }}/${{ github.repository }} --json tagName -t "{{.tagName}}")" -i patch)".TrimStart("v") + ".8-preview." + $d.Year + "." + $d.Month + "." + $d.Day + "." + $d.Hour + "." + $d.Minute + "." + $d.Second + "." + $ENV:GITHUB_RUN_ID) - dotnet pack -c Release /p:Version=$version6 /p:RuntimeFrameworkVersion=6.0.0 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} - dotnet pack -c Release /p:Version=$version6 /p:RuntimeFrameworkVersion=6.0.0 /p:LegacyDotnetTool=1 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} - dotnet pack -c Release /p:Version=$version /p:RuntimeFrameworkVersion=8.0.0 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} - dotnet pack -c Release /p:Version=$version /p:RuntimeFrameworkVersion=8.0.0 /p:LegacyDotnetTool=1 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} + dotnet pack /p:BUILD_OS=Any -c Release /p:Version=$version6 /p:RuntimeFrameworkVersion=6.0.0 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} + dotnet pack /p:BUILD_OS=Any -c Release /p:Version=$version6 /p:RuntimeFrameworkVersion=6.0.0 /p:LegacyDotnetTool=1 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} + dotnet pack /p:BUILD_OS=Any -c Release /p:Version=$version /p:RuntimeFrameworkVersion=8.0.0 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} + dotnet pack /p:BUILD_OS=Any -c Release /p:Version=$version /p:RuntimeFrameworkVersion=8.0.0 /p:LegacyDotnetTool=1 /p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} echo "version=$version" > $env:GITHUB_OUTPUT shell: pwsh working-directory: ./src/Runner.Client From c9602c2d47c5d51372e4a008b51b08e97382ee80 Mon Sep 17 00:00:00 2001 From: Christopher Homberger Date: Mon, 6 Jan 2025 20:14:47 +0100 Subject: [PATCH 3/3] . --- .github/workflows/nuget.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 1dc900b2de0..ccf296a07ef 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -87,14 +87,14 @@ jobs: runs-on: ${{matrix.os}} container: ${{matrix.image}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - if: matrix.dotnet-version uses: actions/setup-dotnet@v3 with: dotnet-version: ${{matrix.dotnet-version}} - run: mkdir src/Runner.Client/nupkg - name: Download Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: nupkg path: src/Runner.Client/nupkg