diff --git a/.github/actions/nuget-publish/action.yml b/.github/actions/nuget-publish/action.yml index 040568cd..93b55c34 100644 --- a/.github/actions/nuget-publish/action.yml +++ b/.github/actions/nuget-publish/action.yml @@ -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 + } \ No newline at end of file diff --git a/.github/actions/nuget-release/action.yml b/.github/actions/nuget-release/action.yml index 19c65a08..07f2ad80 100644 --- a/.github/actions/nuget-release/action.yml +++ b/.github/actions/nuget-release/action.yml @@ -15,6 +15,8 @@ inputs: required: true nuget-directory: required: true + nuspec-file: + required: true tag-prefix: default: '' @@ -57,6 +59,7 @@ 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 @@ -64,7 +67,8 @@ runs: 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 }} \ No newline at end of file diff --git a/.github/workflows/nuget-release.yml b/.github/workflows/nuget-release.yml index 9659185f..37add007 100644 --- a/.github/workflows/nuget-release.yml +++ b/.github/workflows/nuget-release.yml @@ -12,6 +12,9 @@ on: tag-prefix: default: '' type: string + nuspec-file: + type: string + required: true secrets: github-token: required: true @@ -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 }} \ No newline at end of file + github-token: ${{ secrets.github-token }} + nuspec-file: ${{ inputs.nuspec-file }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d576da3..c1c97f21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ on: - closed workflow_dispatch: + permissions: contents: write @@ -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 @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }} @@ -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 }}