Skip to content

Commit

Permalink
continue to publish .net6 to nuget under lower revision
Browse files Browse the repository at this point in the history
* Use LegacyRunner for normal builds again
  * keep using new mode for single file
* .net6 .6 revision
* .net8 .8 revision
  • Loading branch information
ChristopherHX committed Jan 6, 2025
1 parent 0c03a43 commit 67ac28b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
26 changes: 12 additions & 14 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 67ac28b

Please sign in to comment.