Skip to content

Commit

Permalink
ci: remove merge back from release workflow (#102)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Moore <[email protected]>
  • Loading branch information
moorec-aws authored Feb 23, 2024
1 parent 0384123 commit 1bc5945
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 42 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/release_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: Unit Tests
runs-on: ubuntu-latest
environment: release
permissions:
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: release
ref: mainline
fetch-depth: 0
token: ${{ secrets.CI_TOKEN }}

Expand All @@ -49,11 +49,6 @@ jobs:
git config --local user.email "[email protected]"
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=""
Expand Down Expand Up @@ -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"
43 changes: 11 additions & 32 deletions .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
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: |
Expand All @@ -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 "[email protected]"
git config --local user.name "client-software-ci"
git tag -a $TAG -m "Release $TAG"
echo "TAG=$TAG" >> $GITHUB_ENV
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1bc5945

Please sign in to comment.