Skip to content

Commit d42380b

Browse files
committed
chore: Use Release Please for release management.
1 parent 980f92e commit d42380b

11 files changed

Lines changed: 215 additions & 163 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{".":"2.0.9"}

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @devopsix

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ updates:
77
update-types: [ 'version-update:semver-major' ]
88
schedule:
99
interval: 'daily'
10+
commit-message:
11+
prefix: "deps"
1012
open-pull-requests-limit: 100
1113
- package-ecosystem: 'github-actions'
1214
directory: '/'
1315
schedule:
1416
interval: 'daily'
17+
commit-message:
18+
prefix: "deps"
1519
open-pull-requests-limit: 100

.github/release-please-config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"release-type": "maven",
3+
"always-update": true,
4+
"include-v-in-release-name": false,
5+
"packages": {
6+
".": {
7+
}
8+
},
9+
"plugins": [
10+
"sentence-case"
11+
],
12+
"last-release-sha": "7fb8a08fd414e6b4c97bb7432eef172feefeabb0"
13+
}

.github/workflows/build.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
name: Build
22

3-
on: [push]
3+
4+
on:
5+
push:
6+
branches:
7+
# Run for all branches (except for Release Please branches)
8+
# This implies not running for tags
9+
- '**'
10+
- '!release-please--*'
11+
paths:
12+
- '.github/workflows/build.yaml'
13+
- '**/src/**'
14+
- '**/pom.xml'
15+
- 'checkstyle-suppressions.xml'
16+
- '!**/*.md'
17+
- '!.github/CODEOWNERS'
18+
- '!.github/dependabot.yaml'
19+
- '!.github/**/*release-please*'
420

521
jobs:
622
build:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
release-please:
15+
name: Release Please
16+
runs-on: ubuntu-slim
17+
steps:
18+
- name: Generate GitHub App token
19+
id: app-token
20+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
21+
with:
22+
app-id: ${{ vars.RELEASE_APP_ID }}
23+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
24+
- name: Get GitHub App user ID
25+
id: user-id
26+
run: |
27+
echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
28+
env:
29+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
30+
- name: Configure Git settings
31+
run: |
32+
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
33+
git config --global user.email '${{ steps.user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
34+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 #v4
35+
with:
36+
token: ${{ steps.app-token.outputs.token }}
37+
config-file: .github/release-please-config.json
38+
manifest-file: .github/.release-please-manifest.json

.github/workflows/release.yml

Lines changed: 13 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
11
name: Release
2-
run-name: Release ${{ inputs.releaseVersion }}
2+
run-name: Release ${{ github.ref_name }}
33

44
on:
5-
workflow_dispatch:
6-
inputs:
7-
releaseVersion:
8-
description: 'Release version number'
9-
required: true
10-
developmentVersion:
11-
description: 'Next development (snapshot) version number'
12-
required: true
5+
push:
6+
tags:
7+
- 'v[0-9]*'
138

149
jobs:
1510
release:
16-
name: Create release
11+
name: Create Release
1712
runs-on: ubuntu-latest
1813
steps:
19-
- name: Create access token
20-
uses: actions/create-github-app-token@v3
21-
id: app-token
22-
with:
23-
app-id: ${{ vars.RELEASE_APP_ID }}
24-
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
25-
- name: Check out from SCM
26-
uses: actions/checkout@v6
27-
with:
28-
token: ${{ steps.app-token.outputs.token }}
2914
- name: Import GPG key
3015
uses: crazy-max/ghaction-import-gpg@v7
3116
with:
@@ -37,7 +22,9 @@ jobs:
3722
echo "GPG key expires on ${EXPIRY}"
3823
DELTA=$(( $(date --date "${EXPIRY}" '+%s') - $(date '+%s') ))
3924
echo "GPG key expires in ${DELTA} seconds"
40-
[[ ${DELTA} -ge 0 ]]
25+
[[ ${DELTA} -ge 600 ]]
26+
- name: Check out from SCM
27+
uses: actions/checkout@v6
4128
- name: Set up JDK/Maven
4229
uses: actions/setup-java@v5
4330
with:
@@ -52,52 +39,14 @@ jobs:
5239
"username": "${{ secrets.MAVEN_CENTRAL_USER }}",
5340
"password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"
5441
}]
55-
- name: Configure git
56-
run: |
57-
git config --global committer.email "noreply@github.com"
58-
git config --global committer.name "GitHub Actions"
59-
git config --global author.email "${{ github.actor }}@users.noreply.github.com"
60-
git config --global author.name "${{ github.actor }}"
61-
- name: Prepare release
62-
id: prepare_release
63-
run: >-
64-
mvn
65-
--batch-mode
66-
"-DpreparationGoals=clean compile"
67-
"-DreleaseVersion=${{ github.event.inputs.releaseVersion }}"
68-
"-DdevelopmentVersion=${{ github.event.inputs.developmentVersion }}"
69-
"-Dtag=v${{ github.event.inputs.releaseVersion }}"
70-
"-Dusername=${{ github.actor }}"
71-
"-Dpassword=${{ steps.app-token.outputs.token }}"
72-
"-DrepoBaseUrl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
73-
release:prepare
74-
- name: Perform release
75-
id: perform_release
42+
- name: Deploy artifacts
7643
env:
7744
AUTO_RELEASE: ${{ vars.AUTO_RELEASE }}
7845
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
7946
run: >-
8047
mvn
8148
--batch-mode
82-
"-Dgoals=deploy"
83-
"-DreleaseProfiles=release,-examples"
84-
"-Darguments=-DrepoBaseUrl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
85-
"-Dusername=${{ github.actor }}"
86-
"-Dpassword=${{ steps.app-token.outputs.token }}"
87-
"-DrepoBaseUrl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}"
88-
release:perform
89-
- name: Create GitHub release
90-
id: create_github_release
91-
uses: softprops/action-gh-release@v2
92-
with:
93-
tag_name: v${{ github.event.inputs.releaseVersion }}
94-
name: hamcrest-mail-${{ github.event.inputs.releaseVersion }}
95-
body: |-
96-
Release ${{ github.event.inputs.releaseVersion }} of hamcrest-mail
97-
98-
[Change log](${{ github.server_url }}/${{ github.repository }}/blob/main/CHANGES.md)
99-
files: |
100-
./target/checkout/hamcrest-mail/target/hamcrest-mail-${{ github.event.inputs.releaseVersion }}.jar
101-
./target/checkout/hamcrest-mail/target/hamcrest-mail-${{ github.event.inputs.releaseVersion }}-javadoc.jar
102-
./target/checkout/hamcrest-mail-jakarta/target/hamcrest-mail-jakarta-${{ github.event.inputs.releaseVersion }}.jar
103-
./target/checkout/hamcrest-mail-jakarta/target/hamcrest-mail-jakarta-${{ github.event.inputs.releaseVersion }}-javadoc.jar
49+
--activate-profiles=release,-examples
50+
--define=gpg.useagent=false
51+
--define=repoBaseUrl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
52+
deploy

CHANGELOG.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Changelog
2+
3+
## [2.0.9](https://github.com/devopsix/hamcrest-mail/releases/tag/v2.0.9) (2025-10-03)
4+
5+
* Dependencies updated
6+
7+
## [2.0.8](https://github.com/devopsix/hamcrest-mail/releases/tag/v2.0.8) (2025-03-30)
8+
9+
* Dependencies updated
10+
11+
## [2.0.7](https://github.com/devopsix/hamcrest-mail/releases/tag/v2.0.7) (2024-08-07)
12+
13+
* Update to Hamcrest 3.0
14+
* Other dependencies updated
15+
16+
## [2.0.6](https://github.com/devopsix/hamcrest-mail/releases/tag/v2.0.6) (2024-02-15)
17+
18+
* Updated deployment settings, no code changes or dependency updates
19+
20+
## [2.0.5](https://github.com/devopsix/hamcrest-mail/releases/tag/v2.0.5) (2024-01-24)
21+
22+
* Dependencies updated
23+
24+
## 2.0.4 (2024-01-22)
25+
26+
* Release skipped due to issues with Sonatype OSS
27+
28+
## [2.0.3](https://github.com/devopsix/hamcrest-mail/releases/tag/v2.0.3) (2023-12-07)
29+
30+
* Dependencies updated
31+
32+
## [2.0.2](https://github.com/devopsix/hamcrest-mail/releases/tag/v2.0.2) (2023-10-30)
33+
34+
* Dependencies updated
35+
36+
## [2.0.1](https://github.com/devopsix/hamcrest-mail/releases/tag/v2.0.1) (2023-10-29)
37+
38+
* Dependencies updated
39+
40+
## [2.0.0](https://github.com/devopsix/hamcrest-mail/releases/tag/v2.0.0) (2023-03-12)
41+
42+
* Requires JDK 11
43+
* Dependencies updated
44+
45+
## [1.1.1](https://github.com/devopsix/hamcrest-mail/releases/tag/v1.1.1) (2023-01-12)
46+
47+
* Add support for Jakarta EE 9+ / jakarta.mail package.
48+
49+
## [1.0.1](https://github.com/devopsix/hamcrest-mail/releases/tag/v1.0.1) (2023-01-08)
50+
51+
* Dependencies updated
52+
53+
## [1.0.0](https://github.com/devopsix/hamcrest-mail/releases/tag/v1.0.0) (2020-09-05)
54+
55+
*Increment major version in order to indicate it's ready for production use.*
56+
57+
## [0.3.1](https://github.com/devopsix/hamcrest-mail/releases/tag/v0.3.1) (2020-08-26)
58+
59+
* Fixed an issue with parsing DST zone names in date headers.
60+
61+
## [0.3.0](https://github.com/devopsix/hamcrest-mail/releases/tag/v0.3.0) (2020-01-05)
62+
63+
* Added matcher for recursively verifying parts of a multipart message.
64+
65+
## [0.2.0](https://github.com/devopsix/hamcrest-mail/releases/tag/v0.2.0) (2019-12-22)
66+
67+
* Added matchers for verifying multipart content.
68+
* Added matcher for verifying binary content.
69+
70+
## [0.1.0](https://github.com/devopsix/hamcrest-mail/releases/tag/v0.1.0) (2019-12-14)
71+
72+
* Added matcher for verifying DKIM signatures.
73+
* Added matcher for verifying recipients.
74+
* Added matchers for verifying `javax.mail.Address` objects.
75+
* Added basic body matchers.
76+
* Moved all classes to `org.devopsix.hamcrest.mail` package.
77+
* Changed group ID to `org.devopsix`.
78+
79+
## [0.0.1](https://github.com/devopsix/hamcrest-mail/releases/tag/v0.0.1) (2019-12-07)
80+
81+
Initial release.
82+
83+
* Added message header matchers.

CHANGES.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)