diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml deleted file mode 100644 index 49f30798d..000000000 --- a/.github/workflows/prepare-release.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -name: Prepare Release - -on: - workflow_dispatch: - inputs: - branch: - description: 'the branch to prepare the release against' - required: true - default: 'main' - tag: - description: 'the tag to be released' - required: true - -jobs: - prepare: - name: Prepare Release - runs-on: 'ubuntu-latest' - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout - uses: actions/checkout@v7 - with: - ref: ${{ github.event.inputs.branch }} - fetch-depth: 0 - persist-credentials: true # need the changelog ref - - name: Changelog - env: - TAG: ${{ github.event.inputs.tag }} - run: | - git fetch --tags origin refs/notes/changelog:refs/notes/changelog - .github/scripts/changelog-update "${TAG}" - - name: Create Pull Request - uses: peter-evans/create-pull-request@v8 - with: - title: "${{ github.event.inputs.tag }} Changelog Bump" - body: "This is an automated changelog commit." - commit-message: "chore: ${{ github.event.inputs.tag }} changelog bump" - branch: "ready-${{ github.event.inputs.tag }}" - signoff: true - delete-branch: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a5505ff9..d7b89f036 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,11 +20,19 @@ jobs: uses: actions/checkout@v7 with: fetch-depth: 0 - persist-credentials: true # Needed to fetch the changelog ref. - name: Changelog + # The CHANGELOG.md section for this tag is the source of truth; it was + # written by prepare-release before the tag was cut. run: | - git fetch origin refs/notes/changelog:refs/notes/changelog - .github/scripts/changelog-render "${VERSION}" > "${GITHUB_WORKSPACE}/changelog" + awk -v ver="${VERSION}" ' + index($0, "") == 1 { found = 1 } + found && /^