-
-
Notifications
You must be signed in to change notification settings - Fork 13
Update the release flow to take the version as a parameter, and pass it to JReleaser #13
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,10 @@ name: Release to GitHub Packages | |
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Release version' | ||
| required: true | ||
|
|
||
| jobs: | ||
| release: | ||
|
|
@@ -30,28 +34,28 @@ jobs: | |
| git config user.email "actions@github.com" | ||
| git config user.name "GitHub Actions" | ||
|
|
||
| # - name: Setup Git user | ||
| # uses: fregante/setup-git-user@v2 | ||
| # | ||
| # - name: Setup SSH Keys and known_hosts | ||
| # env: | ||
| # SSH_AUTH_SOCK: /tmp/ssh_agent.sock | ||
| # run: | | ||
| # mkdir -p ~/.ssh | ||
| # ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
| # ssh-agent -a $SSH_AUTH_SOCK > /dev/null | ||
| # ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" | ||
| - name: Set Release Version | ||
| id: vars | ||
| shell: bash | ||
| run: | | ||
| echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | ||
| mvn versions:set -DnewVersion=${{ github.event.inputs.version }}-SNAPSHOT | ||
| git commit -m "Releasing version ${{ github.event.inputs.version }}" pom.xml | ||
| git push origin main | ||
|
|
||
| - name: Publish to GitHub Packages | ||
| run: mvn -ntp -B release:prepare release:perform | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
|
|
||
| # Create a release | ||
| # Create a GitHub Release | ||
| # TODO (oleg-nenashev): Consider switching to Release Drafter if there is not significant value except fancy changelog | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW release-drafter works with issues/PRs while JReleaser works with commit messages (though it can also invoke GiHub's "native" release notes generator, which also only works with issues/PRs).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly. Both approaches have their pros and cons, though I got more used to the PR-based approach. I wanted to try out JReleaser on something in any case, at least until we have unified labeling policy and changelog format in the organization, similar to https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.yml |
||
| # ... So far we do not plan to automate release announcements, and artifacts can be attached to the release via another step | ||
| - name: Run JReleaser | ||
| uses: jreleaser/release-action@v2 | ||
| env: | ||
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }} | ||
|
|
||
| # Persist JReleaser logs | ||
| - name: JReleaser release output | ||
|
|
||
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.
Probably should not be called explicitly, Maven Release Plugin will do the push anyway