Skip to content

Commit 2a57cc3

Browse files
committed
streamline CI
1 parent 9af5c5c commit 2a57cc3

4 files changed

Lines changed: 51 additions & 66 deletions

File tree

.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: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +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-and-install@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 --batch-mode deploy
2830
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
31-
release:
32-
timeout-minutes: 5
33-
runs-on: ubuntu-24.04
34-
needs: publish
35-
steps:
36-
- uses: actions/checkout@v4
37-
38-
- name: Create GitHub release
39-
uses: actions/github-script@v7
31+
GITHUB_USER_NAME: ${{ github.actor }}
32+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
4042
with:
41-
script: |
42-
github.rest.repos.createRelease({
43-
owner: context.repo.owner,
44-
repo: context.repo.repo,
45-
tag_name: '${{ github.event.inputs.version }}',
46-
name: 'Release ${{ github.event.inputs.version }}',
47-
prerelease: '${{ github.event.inputs.version }}'.includes('RC')
48-
})
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ Add this library to the classpath by adding the following maven dependency. Vers
2020
The [CustomAccessorNamingStrategy.java](src%2Fmain%2Fjava%2Fit%2Faboutbits%2Fmapstruct%2Fspi%2FCustomAccessorNamingStrategy.java) adds support for Lombok's `@With` methods.
2121
By default, Lombok would treat these generated functions as accessors and would try to map them.
2222

23-
## Local development:
23+
## Local Development
2424

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

2727
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.
2828

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

31-
## Building and releasing a new version:
31+
## Build & Publish
3232

33-
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.
33+
To build and publish the chart, visit the GitHub Actions page of the repository and trigger the workflow "Release Package" manually.
3434

3535
## Information
3636

0 commit comments

Comments
 (0)