Skip to content

Commit

Permalink
Update changelog on both trunk and release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Mar 12, 2021
1 parent b13e319 commit d500373
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/upload-release-to-plugin-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,24 @@ jobs:
echo "::set-output name=release_branch::$(echo $RELEASE_BRANCH)"
update-changelog:
name: Update Changelog
name: Update Changelog on ${{ matrix.branch }} branch
runs-on: ubuntu-latest
if: github.event.release.assets[0]
needs: get-release-branch
env:
TAG: ${{ github.event.release.tag_name }}
strategy:
matrix:
include:
- branch: trunk
label: trunk
- branch: ${{ needs.get-release-branch.outputs.release_branch }}
label: release
steps:
- name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
with:
ref: ${{ needs.get-release-branch.outputs.release_branch }}
ref: ${{ matrix.branch }}

- name: Update the Changelog to include the release notes
run: |
Expand Down Expand Up @@ -64,24 +71,14 @@ jobs:
run: |
git add changelog.txt
git commit -m "Update Changelog for ${TAG#v}"
git push --set-upstream origin "${{ needs.get-release-branch.outputs.release_branch }}"
git push --set-upstream origin "${{ matrix.branch }}"
- name: Upload Changelog artifact
uses: actions/upload-artifact@e448a9b857ee2131e752b06002bf0e093c65e571 # v2.2.2
with:
name: changelog
name: changelog ${{ matrix.label }}
path: ./changelog.txt

- name: Cherry-pick Changelog update to trunk
run: |
git fetch --depth=1 origin trunk
git checkout trunk
TRUNK_VERSION=$(jq --raw-output '.version' package.json)
if [[ "${TAG#v}" == "$TRUNK_VERSION" ]]; then
git cherry-pick "${{ needs.get-release-branch.outputs.release_branch }}"
git push
fi
upload:
name: Upload Gutenberg Plugin
runs-on: ubuntu-latest
Expand Down Expand Up @@ -123,7 +120,7 @@ jobs:
- name: Download Changelog Artifact
uses: actions/download-artifact@4a7a711286f30c025902c28b541c10e147a9b843 # v2.0.8
with:
name: changelog
name: changelog trunk
path: trunk/changelog.txt

- name: Commit the content changes
Expand Down

0 comments on commit d500373

Please sign in to comment.