From 3153e455bf8683e0624cb62f08d214cc0053daf5 Mon Sep 17 00:00:00 2001 From: Charles Moore <122481442+moorec-aws@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:59:27 -0600 Subject: [PATCH] ci: remove merge back from release workflow (#61) Signed-off-by: Charles Moore <122481442+moorec-aws@users.noreply.github.com> --- .github/workflows/release_bump.yml | 15 ++++------ .github/workflows/release_publish.yml | 43 +++++++-------------------- 2 files changed, 16 insertions(+), 42 deletions(-) diff --git a/.github/workflows/release_bump.yml b/.github/workflows/release_bump.yml index d8c195c..d07016f 100644 --- a/.github/workflows/release_bump.yml +++ b/.github/workflows/release_bump.yml @@ -17,15 +17,15 @@ concurrency: group: release jobs: - TestMainline: - name: Test Mainline + UnitTests: + name: Unit Tests uses: ./.github/workflows/code_quality.yml with: branch: mainline secrets: inherit Bump: - needs: TestMainline + needs: UnitTests runs-on: ubuntu-latest environment: release permissions: @@ -35,7 +35,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: release + ref: mainline fetch-depth: 0 token: ${{ secrets.CI_TOKEN }} @@ -49,11 +49,6 @@ jobs: git config --local user.email "129794699+client-software-ci@users.noreply.github.com" git config --local user.name "client-software-ci" - - name: MergePushRelease - run: | - git merge --ff-only origin/mainline -v - git push origin release - - name: Bump run: | BUMP_ARGS="" @@ -93,4 +88,4 @@ jobs: git push -u origin bump/$NEXT_SEMVER # Needs "Allow GitHub Actions to create and approve pull requests" under Settings > Actions - gh pr create --base release --title "chore(release): $NEXT_SEMVER" --body "$RELEASE_NOTES" + gh pr create --base mainline --title "chore(release): $NEXT_SEMVER" --body "$RELEASE_NOTES" diff --git a/.github/workflows/release_publish.yml b/.github/workflows/release_publish.yml index a0cb7de..ec6efa0 100644 --- a/.github/workflows/release_publish.yml +++ b/.github/workflows/release_publish.yml @@ -52,22 +52,23 @@ jobs: with: ref: release fetch-depth: 0 - - - name: VerifyReleaseBranch - run: | - RELEASE_HEAD=$(git show -s --format='%H') - if [[ $RELEASE_HEAD != ${{ github.sha }} ]]; then - echo "ERROR: tip of release branch ($RELEASE_HEAD) does not match the commit that started this release (${{ github.sha }}). Aborting release." - exit 1 - else - echo "Verified tip of release branch ($RELEASE_HEAD) matches the commit that started this release (${{ github.sha }})" - fi + token: ${{ secrets.CI_TOKEN }} - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.9' + - name: ConfigureGit + run: | + git config --local user.email "129794699+client-software-ci@users.noreply.github.com" + git config --local user.name "client-software-ci" + + - name: MergePushRelease + run: | + git merge --ff-only origin/mainline -v + git push origin release + - name: PrepRelease id: prep-release run: | @@ -77,9 +78,6 @@ jobs: # The format of the tag must match the pattern in pyproject.toml -> tool.semantic_release.tag_format TAG="$NEXT_SEMVER" - git config --local user.email "129794699+client-software-ci@users.noreply.github.com" - git config --local user.name "client-software-ci" - git tag -a $TAG -m "Release $TAG" echo "TAG=$TAG" >> $GITHUB_ENV @@ -135,25 +133,6 @@ jobs: git push origin $TAG gh release create $TAG dist/* --notes "$RELEASE_NOTES" - MergeBack: - needs: Release - runs-on: ubuntu-latest - environment: release - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: mainline - fetch-depth: 0 - token: ${{ secrets.CI_TOKEN }} - - - name: MergeBackMainline - run: | - git merge --ff-only origin/release - git push origin mainline - PublishToRepository: needs: Release runs-on: ubuntu-latest