Skip to content

Commit f8a5f60

Browse files
Merge pull request #13 from wiremock/jreleaser-flow-fix
Update the release flow to take the version as a parameter, and pass it to JReleaser
2 parents 2fc91d6 + f5fa0da commit f8a5f60

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Release to GitHub Packages
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
59

610
jobs:
711
release:
@@ -30,28 +34,28 @@ jobs:
3034
git config user.email "actions@github.com"
3135
git config user.name "GitHub Actions"
3236
33-
# - name: Setup Git user
34-
# uses: fregante/setup-git-user@v2
35-
#
36-
# - name: Setup SSH Keys and known_hosts
37-
# env:
38-
# SSH_AUTH_SOCK: /tmp/ssh_agent.sock
39-
# run: |
40-
# mkdir -p ~/.ssh
41-
# ssh-keyscan github.com >> ~/.ssh/known_hosts
42-
# ssh-agent -a $SSH_AUTH_SOCK > /dev/null
43-
# ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
37+
- name: Set Release Version
38+
id: vars
39+
shell: bash
40+
run: |
41+
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
42+
mvn versions:set -DnewVersion=${{ github.event.inputs.version }}-SNAPSHOT
43+
git commit -m "Releasing version ${{ github.event.inputs.version }}" pom.xml
44+
git push origin main
4445
4546
- name: Publish to GitHub Packages
4647
run: mvn -ntp -B release:prepare release:perform
4748
env:
4849
GITHUB_TOKEN: ${{ github.token }}
4950

50-
# Create a release
51+
# Create a GitHub Release
52+
# TODO (oleg-nenashev): Consider switching to Release Drafter if there is not significant value except fancy changelog
53+
# ... So far we do not plan to automate release announcements, and artifacts can be attached to the release via another step
5154
- name: Run JReleaser
5255
uses: jreleaser/release-action@v2
5356
env:
5457
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
5559

5660
# Persist JReleaser logs
5761
- name: JReleaser release output

jreleaser.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ project:
66
homepage: https://github.com/wiremock/wiremock-testcontainers-java
77
authors:
88
- Oleg Nenashev
9+
- WireMock contributors
910
license: APACHE-2.0
1011
inceptionYear: 2023
1112
stereotype: none

0 commit comments

Comments
 (0)