Unverified Commit 2865a3fe authored by ysaito1001's avatar ysaito1001 Committed by GitHub
Browse files

Remove a dead step from release workflow (#3580)

## Motivation and Context
A step `trim-changelog-next-on-main` has been
[skipped](https://github.com/smithy-lang/smithy-rs/actions/workflows/release.yml?query=actor%3Aaws-sdk-rust-ci)
probably since a release branch `smithy-rs-release-1.x.y` was created.

## Description
We no longer directly remove released entries from CHANGELOG.next.toml
on `main`. We do so by backport PRs to merge `smithy-rs-release-1.x.y`
to `main`. So `open-backport-pull-request` now depends on `release`,
instead of `trim-changelog-next-on-main`.

## Testing
`open-backport-pull-request` depending on `release` can only be "tested"
in prod runs, so we'll see what happens in the next release. If
`open-backport-pull-request` fails, we will manually run it and address
whatever issue that comes up.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 2903c5e4
Loading
Loading
Loading
Loading
+2 −36
Original line number Diff line number Diff line
@@ -248,46 +248,12 @@ jobs:
          publisher publish -y --location .
        fi

  trim-changelog-next-on-main:
    name: Remove released entries from CHANGELOG.next.toml on the main branch
    if: inputs.dry_run == false && needs.get-or-create-release-branch.outputs.new_release_series == true
    needs:
    - get-or-create-release-branch
    - release
    runs-on: ubuntu-latest
    steps:
    - name: Checkout smithy-rs
      uses: actions/checkout@v4
      with:
        ref: ${{ inputs.commit_sha }}
        path: smithy-rs
        token: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }}
    - name: Empty CHANGELOG.next.toml
      uses: ./smithy-rs/.github/actions/docker-build
      with:
        action: generate-new-changelog-next-toml
    - name: Download all artifacts
      uses: ./smithy-rs/.github/actions/download-all-artifacts
    - name: Push smithy-rs changes
      working-directory: generate-new-changelog-next-toml/smithy-rs
      shell: bash
      run: |
        set -eux

        # This will fail if other commits have been pushed to `main` after `commit_sha`
        # In particular, this will ALWAYS fail if you are creating a new release series from
        # a commit that is not the current tip of `main`.
        # We can build more refined automation to handle this case in the future - until then, it'll require
        # a manual PR to edit the current CHANGELOG.next.toml file and remove the released entries.
        git -c 'user.name=AWS SDK Rust Bot' -c 'user.email=aws-sdk-rust-primary@amazon.com' commit CHANGELOG.next.toml --message "Remove released entries from \`CHANGELOG.next.toml\`"
        git push origin main

  open-backport-pull-request:
    name: Open backport pull request to merge the release branch back to main
    needs:
    - trim-changelog-next-on-main
    - release
    # See https://github.com/actions/runner/issues/2205#issuecomment-1381988186 for details on the workaround
    if: inputs.dry_run == false && always() && needs.trim-changelog-next-on-main.result == 'success'
    if: inputs.dry_run == false && always() && needs.release.result == 'success'
    uses: ./.github/workflows/backport-pull-request.yml
    secrets:
      RELEASE_AUTOMATION_BOT_PAT: ${{ secrets.RELEASE_AUTOMATION_BOT_PAT }}