Skip to content

Commit 0e910af

Browse files
committed
Add build and release workflows
Signed-off-by: Thomas Günther <[email protected]>
1 parent d9124c4 commit 0e910af

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/build.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
name: Build
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
distribution: ['temurin']
14+
java: ['17', '21']
15+
name: Java ${{matrix.java}} (${{matrix.distribution}}) sample
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-java@v4
19+
with:
20+
distribution: ${{matrix.distribution}}
21+
java-version: ${{matrix.java}}
22+
cache: maven
23+
- name: Build with Maven
24+
run: mvn --batch-mode verify

.github/workflows/release.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3+
4+
name: Release
5+
6+
on:
7+
release:
8+
types: [created]
9+
workflow_dispatch:
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-java@v4
20+
with:
21+
java-version: '17'
22+
distribution: 'temurin'
23+
- name: Publish package
24+
run: mvn --batch-mode deploy
25+
env:
26+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)