forked from ethereum/execution-spec-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): update post release workflow.
- Loading branch information
1 parent
62a7c91
commit f685b90
Showing
3 changed files
with
66 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Post Release Automation | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure git user for actions | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Action" | ||
- name: Set environment variables | ||
run: | | ||
echo "NEW_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | ||
echo "NEW_BRANCH=release-${{ github.event.release.tag_name }}" >> $GITHUB_ENV | ||
echo "COMMIT_MSG=feat(docs|fw): post ${{ github.event.release.tag_name }} release changes" >> $GITHUB_ENV | ||
- name: Bump version in setup configuration | ||
run: | | ||
sed -i "s/^version = .*/version = $NEW_VERSION/" setup.cfg | ||
git add setup.cfg | ||
- name: Update changelog with release details | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RELEASE_DATE: $(date +'%Y-%m-%d') | ||
run: | | ||
# Replace unreleased link with the new release information | ||
RELEASE_DATE=$(date +'%Y-%m-%d') | ||
ESCAPED_LINK="https:\/\/github.com\/ethereum\/execution-spec-tests\/releases\/tag\/${NEW_VERSION}" | ||
RELEASE_NAME=$(gh release view ${NEW_VERSION} --json body -q '.body' | grep '^#' | head -n 1 | sed 's/^# //') | ||
sed -i "s/^## 🔜 \[Unreleased\].*/## [${NEW_VERSION}](${ESCAPED_LINK}) - ${RELEASE_DATE}: ${RELEASE_NAME}/" docs/CHANGELOG.md | ||
# Append changelog template for the new unreleased section | ||
{ echo ""; tail -n +5 docs/changelog_section_template.md; } > temp_template.md | ||
sed -i '/\*\*Key:\*\*/ r temp_template.md' docs/CHANGELOG.md | ||
rm temp_template.md | ||
git add docs/CHANGELOG.md | ||
- name: Create pull request with relevant changes | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ env.NEW_BRANCH }} | ||
commit-message: ${{ env.COMMIT_MSG }} | ||
title: ${{ env.COMMIT_MSG }} | ||
body: | | ||
## 🗒️ Description | ||
Post ${{ env.NEW_VERSION }} release changes: | ||
- Bump version within `setup.cfg`. | ||
- Update `CHANGELOG.md` and copy in `changelog_section_template.md`. | ||
base: main |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters