Skip to content
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
28 changes: 16 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Release to GitHub Packages

on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true

jobs:
release:
Expand Down Expand Up @@ -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
Copy link
Copy Markdown
Member Author

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


- 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The 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).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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
Expand Down
1 change: 1 addition & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ project:
homepage: https://github.com/wiremock/wiremock-testcontainers-java
authors:
- Oleg Nenashev
- WireMock contributors
license: APACHE-2.0
inceptionYear: 2023
stereotype: none
Expand Down