Skip to content

Commit 2e58a55

Browse files
committed
streamline CI
1 parent e0d8f68 commit 2e58a55

4 files changed

Lines changed: 48 additions & 59 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: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +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+
build-and-publish:
13+
runs-on: ubuntu-24.04
1214
timeout-minutes: 15
13-
runs-on: ubuntu-22.04
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-
tag:
33-
timeout-minutes: 5
34-
runs-on: ubuntu-22.04
35-
needs: publish
36-
steps:
37-
- uses: actions/checkout@v4
38-
39-
- name: Tag Deployment
40-
uses: aboutbits/github-actions-base/git-create-or-update-tag@v1
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-
tag-name: ${{ github.event.inputs.version }}
43-
user-name: 'AboutBits'
44-
user-email: 'info@aboutbits.it'
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ Check out this repository and run the maven goal `install`. This will build and
8888

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

91-
## Building and releasing a new version:
91+
## Build & Publish
9292

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

9595
## Information
9696

0 commit comments

Comments
 (0)