Skip to content

Commit

Permalink
chore: Improve hot-fix & release process to generate a PR for merging…
Browse files Browse the repository at this point in the history
… back to main (#13044)
  • Loading branch information
jimblanc committed Feb 22, 2024
1 parent 4377bdd commit 2e460c0
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/callable-npm-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ name: Release to npm and update repository
on: workflow_call

jobs:
deploy-prep:
name: Prepare for release
runs-on: ubuntu-latest
steps:
- name: Generate a temporary branch name for merge PR
id: generate-branch-name
run: |
echo "BRANCH_NAME=temp/release-merge-$(date +%s)" >> "$GITHUB_OUTPUT"
outputs:
branch_name: ${{ steps.generate-branch-name.outputs.BRANCH_NAME }}

deploy:
name: Publish to Amplify Package
runs-on: ubuntu-latest
needs: deploy-prep
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -47,9 +59,18 @@ jobs:
git add ./docs/api/
git commit -m "chore(release): update API docs [ci skip]"
- name: Push post release changes
- name: Push post release changes to the release branch
working-directory: ./amplify-js
run: |
git push origin release
if [ $(git tag -l "required-release") ]; then git push -f origin required-release; fi
git push --force-with-lease origin release:main
- name: Create a PR to merge temporary release branch into main development branch
working-directory: ./amplify-js
env:
TEMP_BRANCH_NAME: ${{ needs.deploy-prep.outputs.branch_name }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_AMPLIFY_JS_WRITE }}
run: |
git checkout -b $TEMP_BRANCH_NAME
git push origin $TEMP_BRANCH_NAME
gh pr create -B main -H $TEMP_BRANCH_NAME --title 'chore: Merge release into main' --body 'Merge the recently completed release back into the main development branch. Generated by the callable-npm-publish-release workflow.'

0 comments on commit 2e460c0

Please sign in to comment.