diff --git a/.github/workflows/determine-version.yml b/.github/workflows/determine-version.yml index 64b8a617..758484d1 100644 --- a/.github/workflows/determine-version.yml +++ b/.github/workflows/determine-version.yml @@ -19,10 +19,10 @@ on: required: false default: '9.0.x' gitversion-version: - description: 'Version of GitVersion to use. Default: ''6.0.x''.' + description: 'Version of GitVersion to use. Default: ''6.1.x''.' required: false type: string - default: '6.0.x' + default: '6.1.x' prerelease-tag: description: 'The prerelease tag to use. Default: ''''.' type: string @@ -65,16 +65,15 @@ jobs: fetch-depth: 0 - name: 'Setup GitVersion ${{ env.git-version }}' - uses: gittools/actions/gitversion/setup@v3.2.1 + uses: gittools/actions/gitversion/setup@v4.0.1 with: versionSpec: ${{ inputs.gitversion-version }} preferLatestVersion: true - name: 'Determine version' id: gitversion - uses: gittools/actions/gitversion/execute@v3.2.1 + uses: gittools/actions/gitversion/execute@v4.0.1 with: - useConfigFile: true configFilePath: ${{ inputs.config-file-path }} - name: 'Set friendly version' diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml new file mode 100644 index 00000000..c89ffd1a --- /dev/null +++ b/.github/workflows/publish-documentation.yml @@ -0,0 +1,56 @@ +name: 'Publish Documentation' + +on: + workflow_dispatch: + push: + branches: + - 'docs' + paths: + - 'docs/**' + +jobs: + release-package: + name: ${{ inputs.environment }} + runs-on: ubuntu-latest + + env: + working-directory: '/packages/${{ github.run_id }}-${{ github.run_attempt }}' + + environment: + name: ${{ inputs.environment }} + + steps: + + - if: ${{ !(inputs.nuget-feed-server == 'NuGet' || inputs.nuget-feed-server == 'AzureArtifacts') }} + name: 'Invalid NuGet feed server type' + shell: bash + run: | + echo 'Invalid NuGet feed server type ${{ inputs.nuget-feed-server }}. Allowed values are 'NuGet' or 'AzureArtifacts'.' + exit 1 + + - name: 'Setup .NET ${{ inputs.dotnet-sdk-version }}' + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ inputs.dotnet-sdk-version }} + + - name: 'Download artifact' + uses: actions/download-artifact@v4 + with: + run-id: ${{ inputs.artifact-run-id }} + name: ${{ inputs.artifact-name }} + path: ${{ runner.temp }}/${{ env.working-directory }} + + - if: ${{ inputs.nuget-feed-server == 'NuGet' }} + name: 'Publish package to NuGet' + shell: bash + run: | + dotnet nuget push **/*.nupkg --source ${{ vars.NUGET_PACKAGE_FEED_URL }} --api-key ${{ secrets.NUGET_PACKAGE_FEED_API_KEY }} + working-directory: ${{ runner.temp }}/${{ env.working-directory }} + + - if: ${{ inputs.nuget-feed-server == 'AzureArtifacts' }} + name: 'Publish package to Azure Artifacts' + shell: bash + run: | + dotnet nuget add source ${{ vars.NUGET_PACKAGE_FEED_URL }} --name nuget-feed --username username --password ${{ secrets.NUGET_PACKAGE_FEED_API_KEY }} --store-password-in-clear-text + dotnet nuget push **/*.nupkg --source nuget-feed --api-key ${{ secrets.NUGET_PACKAGE_FEED_API_KEY }} --skip-duplicate + working-directory: ${{ runner.temp }}/${{ env.working-directory }} \ No newline at end of file