Skip to content

Commit 52243ad

Browse files
committed
streamline CI
1 parent 5ad5066 commit 52243ad

File tree

4 files changed

+52
-68
lines changed

4 files changed

+52
-68
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
name: Test
1+
name: Main
22

3-
on:
4-
pull_request:
5-
types: [ opened, reopened, synchronize ]
3+
on: push
64

75
concurrency:
86
group: ${{ github.ref }}
97
cancel-in-progress: true
108

119
jobs:
1210
test:
13-
name: Tests
14-
uses: ./.github/workflows/test.yml
11+
runs-on: ubuntu-24.04
12+
timeout-minutes: 10
13+
steps:
14+
- uses: actions/checkout@v5
15+
- uses: aboutbits/github-actions-java/setup-with-maven@v4
16+
with:
17+
java-version: 21
18+
- name: Test
19+
env:
20+
GITHUB_USER_NAME: ${{ github.actor }}
21+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
run: >-
23+
./mvnw
24+
-s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml
25+
--batch-mode
26+
--fail-fast
27+
-Dsurefire.failIfNoSpecifiedTests=false
28+
test
29+
shell: bash

.github/workflows/publish.yml

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,43 @@
1-
name: Publish package to GitHub Packages
1+
name: Release Package
2+
23
on:
34
workflow_dispatch:
45
inputs:
56
version:
6-
description: "Version name to publish (eg: x.x.x)"
7+
description: "Version (eg: x.x.x)"
78
type: string
89
required: true
910

1011
jobs:
11-
publish:
12-
timeout-minutes: 15
12+
build-and-publish:
1313
runs-on: ubuntu-24.04
14+
timeout-minutes: 15
1415
permissions:
1516
contents: read
1617
packages: write
17-
1818
steps:
19-
- uses: actions/checkout@v4
20-
21-
- uses: aboutbits/github-actions-java/setup@v3
22-
23-
- name: Set Version
24-
run: sed -i 's|<version>BUILD-SNAPSHOT</version>|<version>${{ github.event.inputs.version }}</version>|g' pom.xml
25-
19+
- uses: actions/checkout@v5
20+
with:
21+
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
22+
- uses: aboutbits/github-actions-base/git-setup@v2
23+
- uses: aboutbits/github-actions-java/setup-with-maven@v4
24+
with:
25+
java-version: 21
26+
- uses: aboutbits/github-actions-java/set-version-with-maven@v4
27+
with:
28+
version: "${{ github.event.inputs.version }}"
2629
- name: Publish package
27-
run: mvn -s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml --batch-mode deploy
2830
env:
2931
GITHUB_USER_NAME: ${{ github.actor }}
3032
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
32-
release:
33-
timeout-minutes: 5
34-
runs-on: ubuntu-24.04
35-
needs: publish
36-
steps:
37-
- uses: actions/checkout@v4
38-
39-
- name: Create GitHub release
40-
uses: actions/github-script@v7
33+
run: mvn -s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml --batch-mode deploy
34+
shell: bash
35+
- uses: aboutbits/github-actions-base/git-commit-and-push-all@v2
36+
with:
37+
message: '${{ github.event.inputs.version }}'
38+
- uses: aboutbits/github-actions-base/git-create-or-update-tag@v2
39+
with:
40+
tag-name: 'v${{ github.event.inputs.version }}'
41+
- uses: aboutbits/github-actions-base/github-create-release@v2
4142
with:
42-
script: |
43-
github.rest.repos.createRelease({
44-
owner: context.repo.owner,
45-
repo: context.repo.repo,
46-
tag_name: '${{ github.event.inputs.version }}',
47-
name: 'Release ${{ github.event.inputs.version }}',
48-
prerelease: '${{ github.event.inputs.version }}'.includes('RC')
49-
})
43+
tag-name: 'v${{ github.event.inputs.version }}'

.github/workflows/test.yml

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

readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void testValidationWithIdParameter() {
149149
}
150150
```
151151

152-
#### Adding custom validation rules
152+
#### Adding Custom Validation Rules
153153

154154
You can add new rules by creating a new interface:
155155

@@ -177,7 +177,7 @@ public class ValidationAssert extends BaseValidationAssert<BaseRuleBuilder<?>> {
177177
The `Rule` requires the property name, a value-source and an array of optional parameters. For example `min(property, minValue)` takes in the additional parameter for the value.
178178
Note that the value-source must return **invalid** values. This is required because the tool is actively trying to violate the rules to check if an error is raised.
179179

180-
#### Adding custom value sources
180+
#### Adding Custom Value Sources
181181

182182
You can add custom values sources by implementing the `ValueSource` interface.
183183
While the interface can not enforce the static function `registerType`, it is best practice to implement it in a way that keeps this extensible.
@@ -221,7 +221,7 @@ public class EmptyValueSource implements ValueSource {
221221
}
222222
```
223223

224-
#### Adding support for custom types
224+
#### Adding Support for Custom Types
225225

226226
_Note: CustomType wrappers from the `toolbox` are currently not natively supported._
227227

@@ -257,17 +257,17 @@ public class ValidationAssert extends BaseValidationAssert<BaseRuleBuilder<?>> {
257257
}
258258
```
259259

260-
## Local development:
260+
## Local Development
261261

262262
To use this library as a local development dependency, you can simply refer to the version `BUILD-SNAPSHOT`.
263263

264264
Check out this repository and run the maven goal `install`. This will build and install this library as version `BUILD-SNAPSHOT` into your local maven cache.
265265

266266
Note that you may have to tell your IDE to reload your main maven project each time you build the library.
267267

268-
## Building and releasing a new version:
268+
## Build & Publish
269269

270-
To create a new version of this package and push it to the maven registry, you will have to use the GitHub actions workflow and manually trigger it.
270+
To build and publish the chart, visit the GitHub Actions page of the repository and trigger the workflow "Release Package" manually.
271271

272272
## Information
273273

0 commit comments

Comments
 (0)