diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml index 2a579943..67fe7ee5 100644 --- a/.github/workflows/publish-documentation.yml +++ b/.github/workflows/publish-documentation.yml @@ -2,12 +2,7 @@ on: workflow_dispatch: - push: - branches: - - 'release/**' - paths: - - 'src/**' - - 'api-reference/**' + workflow_call: permissions: actions: read @@ -100,8 +95,8 @@ jobs: id: discover-versions shell: bash run: | - versions=$(ls api-reference/ | grep -E '^\d+\.\d+$' | sort -V | paste -sd ',' -) - latest=$(ls api-reference/ | grep -E '^\d+\.\d+$' | sort -V | tail -1) + versions=$(ls api-reference/ | grep -E '^[0-9]+\.[0-9]+$' | sort -V | paste -sd ',' -) + latest=$(ls api-reference/ | grep -E '^[0-9]+\.[0-9]+$' | sort -V | tail -1) echo "versions=$versions" >> $GITHUB_OUTPUT echo "latest=$latest" >> $GITHUB_OUTPUT diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b8113bf4..3d4b1996 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -206,9 +206,20 @@ jobs: ${{ runner.temp }}/${{ env.nuget-packages-directory }}/**/*.nupkg ${{ runner.temp }}/${{ env.nuget-packages-directory }}/**/*.snupkg + publish-documentation: + name: 'Publish documentation' + needs: [pack, validate-release, workflow-variables] + if: ${{ needs.workflow-variables.outputs.is-release == 'true' }} + uses: ./.github/workflows/publish-documentation.yml + permissions: + actions: read + pages: write + id-token: write + publish-package: name: 'Publish package' - needs: [pack, validate-release] + needs: [pack, validate-release, publish-documentation] + if: ${{ always() && needs.pack.result == 'success' && needs.validate-release.result == 'success' && (needs.publish-documentation.result == 'success' || needs.publish-documentation.result == 'skipped') }} env: package-artifact-name: ${{ needs.pack.outputs.package-artifact-name }} runs-on: ubuntu-latest @@ -243,12 +254,14 @@ jobs: steps: - name: 'Checkout ${{ github.head_ref || github.ref }}' uses: actions/checkout@v6 + with: + fetch-tags: true - name: 'Determine notes start tag' id: determine-notes-start-tag run: | - notes-start-tag=$(git describe --abbrev=0 --tags) - echo "notes-start-tag=$notes-start-tag" >> $GITHUB_OUTPUT + notes_start_tag=$(git describe --abbrev=0 --tags 2>/dev/null || echo "") + echo "notes-start-tag=$notes_start_tag" >> $GITHUB_OUTPUT shell: bash - name: 'Create GitHub Release'