-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
v0.1 of GHA release automation #3094
Conversation
f82d20f
to
04e81a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems promising! could you check my remarks please? could you maybe let the result of the workflows sit somewhere for us to see what's the end result?
thanks!
- name: Update version numbers in key files | ||
run: | | ||
# sed -ri "s/'([0-9]+(\.[0-9]+)*)'/'${{ github.event.inputs.release_number }}'/" dojo/__init__.py | ||
sed -ri "s/__version__ = '.*'/__version__ = '${{ github.event.inputs.release_number }}'/" dojo/__init__.py | ||
sed -ri "s/version='.*'/version='${{ github.event.inputs.release_number }}'/" setup.py | ||
sed -ri "s/appVersion: \"([0-9]+(\.[0-9]+)*)\"/appVersion: \"${{ github.event.inputs.release_number }}\"/" helm/defectdojo/Chart.yaml | ||
- name: Check numbers | ||
run: | | ||
grep version dojo/__init__.py | ||
grep version setup.py | ||
grep appVersion helm/defectdojo/Chart.yaml | ||
- name: Push version changes | ||
uses: stefanzweifel/git-auto-commit-action@v4.1.2 | ||
with: | ||
commit_user_name: "${{ env.GIT_USERNAME }}" | ||
commit_user_email: "${{ env.GIT_EMAIL }}" | ||
commit_author: "${{ env.GIT_USERNAME }} <${{ env.GIT_EMAIL }}>" | ||
commit_message: "Update versions in application files" | ||
branch: ${{ github.head_ref }} | ||
- id: set-repo-org |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we change the version on dev branch before running this workflow, this duplicated version managment can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean like manually modifying before running the workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the workflow. same as new-release-pr.yml but merges to dev instead of master, and rename the file to 01-version-change-on-dev-pr.yml.
if we remove the new-release-merge-back-to-master-pr.yml the version will be outdated in dev branch. it was serving at least this purpose although it's a pretty ugly way to have this version set in dev branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed: the version in dev is diffferent than the version in the release so OK to leave it as it is for now
or, how about this?
|
The goal was not to re-imagine our release process, rather automate the existing one. Be my guest to rework these in another PR. |
it's almost the same, just more straight forward and with less code duplication. we can discuss this and if everyone agree I can do the changes this week |
nice job @madchap. At some point I'd like to see if we can get rid of that json (de)serialization parts that looks a bit out of place. Otherwise great to have some automation. Automate the release, so we have more time discuss topics on the agenda in the future. |
Base
master
is right.This PR brings some automation to our release process. This is a v0.1 which I feel confident we can try for 1.9.0, but will appreciate eyes on it prior to that.
Example of a manually merged PR, created by the GHA
The PR created by the 1st workflow needs to be merged before proceeding.
3. Added a third action to mergemaster
back todev
.