Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikprijck committed Dec 20, 2023
1 parent c92586d commit d192f14
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
19 changes: 14 additions & 5 deletions .github/actions/nuget-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,32 @@ inputs:
required: true
nuget-directory:
required: true
nuspec-file:
required: true

runs:
using: composite
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ inputs.dotnet-version }}

- name: Setup NuGet
uses: nuget/setup-nuget@v1

- name: Create NuGet packages
shell: pwsh
run: dotnet pack "${{ inputs.project-path }}" --configuration Release --output ${{ inputs.nuget-directory }}
run: nuget pack ${{ inputs.nuspec-file }} -OutputDirectory ${{ inputs.nuget-directory }}

- name: Create NuGet packages
shell: bash
run: ls ${{ inputs.nuget-directory }}

- name: Publish NuGet packages
shell: pwsh
run: dotnet nuget push "${{ inputs.project-path }}" --api-key "${{ inputs.nuget-token }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
run: |
foreach($file in (Get-ChildItem "${{ inputs.nuget-directory }}" -Recurse -Include *.nupkg)) {
nuget push $file -ApiKey "${{ inputs.nuget-token }}" -Source https://api.nuget.org/v3/index.json -SkipDuplicate -NonInteractive
}
6 changes: 5 additions & 1 deletion .github/actions/nuget-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ inputs:
required: true
nuget-directory:
required: true
nuspec-file:
required: true
tag-prefix:
default: ''

Expand Down Expand Up @@ -57,14 +59,16 @@ runs:
project-path: ${{ inputs.project-path }}
nuget-token: ${{ inputs.nuget-token }}
nuget-directory: ${{ inputs.nuget-directory }}
nuspec-file: ${{ inputs.nuspec-file }}

# Create a release for the tag
- uses: ./.github/actions/release-create
if: steps.tag_exists.outputs.exists == 'false'
with:
token: ${{ inputs.github-token }}
name: ${{ steps.get_version.outputs.version }}
body: ${{ steps.get_release_notes.outputs.release-notes }}
# body: ${{ steps.get_release_notes.outputs.release-notes }}
body: ''
tag: ${{ inputs.tag-prefix }}${{ steps.get_version.outputs.version }}
commit: ${{ github.sha }}
prerelease: ${{ steps.get_prerelease.outputs.prerelease }}
8 changes: 6 additions & 2 deletions .github/workflows/nuget-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
tag-prefix:
default: ''
type: string
nuspec-file:
type: string
required: true
secrets:
github-token:
required: true
Expand Down Expand Up @@ -41,6 +44,7 @@ jobs:
dotnet-version: ${{ inputs.dotnet-version }}
project-path: ${{ inputs.project-path }}
tag-prefix: ${{ inputs.tag-prefix }}
nuget-directory: ${{ github.workspace}}/nuget
nuget-directory: ${{ inputs.project-path }}/nuget
nuget-token: ${{ secrets.nuget-token }}
github-token: ${{ secrets.github-token }}
github-token: ${{ secrets.github-token }}
nuspec-file: ${{ inputs.nuspec-file }}
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- closed
workflow_dispatch:


permissions:
contents: write

Expand Down Expand Up @@ -35,7 +36,7 @@ jobs:
uses: actions/setup-dotnet@v3

- name: Install .NET Android and iOS workload
run: dotnet workload install android ios
run: dotnet workload install android ios maui

- name: Setup NuGet
uses: nuget/setup-nuget@v1
Expand Down Expand Up @@ -63,6 +64,7 @@ jobs:
with:
tag-prefix: 'android-'
project-path: "src/Auth0.OidcClient.Android"
nuspec-file: "nuget/Auth0.OidcClient.Android.nuspec"
secrets:
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -74,6 +76,7 @@ jobs:
with:
tag-prefix: 'androidx-'
project-path: "src/Auth0.OidcClient.AndroidX"
nuspec-file: "nuget/Auth0.OidcClient.AndroidX.nuspec"
secrets:
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -85,6 +88,7 @@ jobs:
with:
tag-prefix: 'ios-'
project-path: "src/Auth0.OidcClient.iOS"
nuspec-file: "nuget/Auth0.OidcClient.iOS.nuspec"
secrets:
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -96,6 +100,7 @@ jobs:
with:
tag-prefix: 'core-'
project-path: "src/Auth0.OidcClient.Core"
nuspec-file: "nuget/Auth0.OidcClient.Core.nuspec"
secrets:
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -107,6 +112,7 @@ jobs:
with:
tag-prefix: 'wpf-'
project-path: "src/Auth0.OidcClient.WPF"
nuspec-file: "nuget/Auth0.OidcClient.WPF.nuspec"
secrets:
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -118,6 +124,7 @@ jobs:
with:
tag-prefix: 'winforms-'
project-path: "src/Auth0.OidcClient.WinForms"
nuspec-file: "nuget/Auth0.OidcClient.WinForms.nuspec"
secrets:
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -129,6 +136,7 @@ jobs:
with:
tag-prefix: 'uwp-'
project-path: "src/Auth0.OidcClient.UWP"
nuspec-file: "nuget/Auth0.OidcClient.UWP.nuspec"
secrets:
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -140,6 +148,7 @@ jobs:
with:
tag-prefix: 'maui-'
project-path: "src/Auth0.OidcClient.MAUI"
nuspec-file: "nuget/Auth0.OidcClient.MAUI.nuspec"
secrets:
nuget-token: ${{ secrets.NUGET_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit d192f14

Please sign in to comment.