Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automation to update the Besu version #126

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Update Version

on:
workflow_dispatch:
inputs:
version:
required: true
type: string
description: 'Besu version to be updated'
name:
required: true
type: string
description: 'Name of the author to be included in git commit signature'
email:
required: true
type: string
description: 'Email of the author to be included in git commit signature'

jobs:
update:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Setup branch name
id: branch
run: |
echo "BRANCH=update-${{ inputs.version }}-${{ github.run_number }}" >> "$GITHUB_OUTPUT"

- name: Update version
run: |
git config --global user.name "${{ inputs.name }}"
git config --global user.email "${{ inputs.email }}"
git checkout -b $BRANCH
bash updateBesu.sh ${{ inputs.version }}
git status -s | grep " M " | grep -q besu.rb || {
echo "No changes found in the besu.rb"
exit 1
}
git add besu.rb
git commit -s -m "Update Besu version ${{ inputs.version }}"
git push origin $BRANCH
env:
BRANCH: ${{ steps.branch.outputs.BRANCH }}

- name: Create Pull Request [permission needed]
run: |
gh pr create --base main --title "Update Besu version ${{ inputs.version }}" --body "Besu version update to ${{ inputs.version }}" || {
echo "Action does not have permission to create PRs. Ignoring..."
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ To upgrade besu:
brew tap hyperledger/besu
brew upgrade besu
```

## Version update workflow

Use GitHub [workflow](.github/workflows/update-version.yml) to updated the version. Run the workflow to perform new
release update. Workflow requires Besu version, name of the git author and the email of the aurther. If the workflow
have permission to create pull requests, it will create the PR. If not user need to create the pull request using the
created branch.
Loading