Skip to content

Commit 57f701a

Browse files
committed
add ide config and pipelines
1 parent 990f7de commit 57f701a

11 files changed

Lines changed: 205 additions & 42 deletions

File tree

.github/workflows/main.yml

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,14 @@
1-
name: Publish package to GitHub Packages
2-
on:
3-
workflow_dispatch:
4-
inputs:
5-
version:
6-
description: "Version name to publish (eg: x.x.x)"
7-
type: string
8-
required: true
9-
10-
jobs:
11-
publish:
12-
timeout-minutes: 15
13-
runs-on: ubuntu-22.04
14-
permissions:
15-
contents: read
16-
packages: write
17-
18-
steps:
19-
- uses: actions/checkout@v4
1+
name: Test
202

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-
26-
- name: Publish package
27-
run: mvn --batch-mode deploy
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3+
on:
4+
pull_request:
5+
types: [ opened, reopened, synchronize ]
306

31-
tag:
32-
timeout-minutes: 5
33-
runs-on: ubuntu-22.04
34-
needs: publish
35-
steps:
36-
- uses: actions/checkout@v4
7+
concurrency:
8+
group: ${{ github.ref }}
9+
cancel-in-progress: true
3710

38-
- name: Tag Deployment
39-
uses: aboutbits/github-actions-base/git-create-or-update-tag@v1
40-
with:
41-
tag-name: ${{ github.event.inputs.version }}
42-
user-name: 'AboutBits'
43-
user-email: 'info@aboutbits.it'
11+
jobs:
12+
test:
13+
name: Tests
14+
uses: ./.github/workflows/test.yml
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
4+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
5+
6+
<activeProfiles>
7+
<activeProfile>github</activeProfile>
8+
</activeProfiles>
9+
10+
<profiles>
11+
<profile>
12+
<id>github</id>
13+
<repositories>
14+
<repository>
15+
<id>central</id>
16+
<url>https://repo1.maven.org/maven2</url>
17+
</repository>
18+
<repository>
19+
<id>github</id>
20+
<url>https://maven.pkg.github.com/aboutbits/*</url>
21+
</repository>
22+
</repositories>
23+
</profile>
24+
</profiles>
25+
26+
<servers>
27+
<server>
28+
<id>github</id>
29+
<username>${env.GITHUB_USER_NAME}</username>
30+
<password>${env.GITHUB_ACCESS_TOKEN}</password>
31+
</server>
32+
</servers>
33+
</settings>

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish package to GitHub Packages
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: "Version name to publish (eg: x.x.x)"
7+
type: string
8+
required: true
9+
10+
jobs:
11+
publish:
12+
timeout-minutes: 15
13+
runs-on: ubuntu-22.04
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
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+
26+
- name: Publish package
27+
run: mvn --batch-mode deploy
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
tag:
32+
timeout-minutes: 5
33+
runs-on: ubuntu-22.04
34+
needs: publish
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Tag Deployment
39+
uses: aboutbits/github-actions-base/git-create-or-update-tag@v1
40+
with:
41+
tag-name: ${{ github.event.inputs.version }}
42+
user-name: 'AboutBits'
43+
user-email: 'info@aboutbits.it'

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test:
8+
name: Maven-Java
9+
runs-on: ubuntu-22.04
10+
timeout-minutes: 10
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: aboutbits/github-actions-java/setup@v3
14+
with:
15+
java-version: 21
16+
- run: >-
17+
./mvnw
18+
-s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml
19+
--batch-mode
20+
--fail-fast
21+
-Dsurefire.failIfNoSpecifiedTests=false
22+
test
23+
env:
24+
GITHUB_USER_NAME: ${{ github.actor }}
25+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,19 @@ target/
1414
.sts4-cache
1515

1616
### IntelliJ IDEA ###
17-
.idea
18-
*.iws
17+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
18+
.idea/*
19+
!.idea/codeStyles
20+
!.idea/.gitignore
21+
!.idea/checkstyle-idea.xml
22+
!.idea/encodings.xml
23+
!.idea/misc.xml
24+
!.idea/sqldialects.xml
25+
!.idea/vcs.xml
26+
1927
*.iml
2028
*.ipr
29+
*.iws
2130

2231
### NetBeans ###
2332
/nbproject/private/

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/checkstyle-idea.xml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/Project.xml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)