Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

continue to publish .net6 to nuget under lower revision #502

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
30 changes: 14 additions & 16 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 /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
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 Expand Up @@ -89,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
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
Loading