From f724007d6b5bae2e474577637d9b4ad21c2e7d00 Mon Sep 17 00:00:00 2001 From: Fred Deniger Date: Wed, 24 Apr 2024 11:22:16 +0200 Subject: [PATCH] add github actions --- .github/workflows/maven.yml | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..dc7a801 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,47 @@ +name: Build with Maven + +on: + push: + branches: [ main-icrc ] + pull_request: + branches: [ main-icrc ] + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + platform: [ ubuntu-latest ] + java-version: [ 8 ] + + runs-on: ${{ matrix.platform }} + permissions: + contents: read + packages: write + env: + PLATFORM: ${{ matrix.platform }} + JAVA_VERSION: ${{ matrix.java-version }} + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Install dependencies + run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true --batch-mode --show-version --file pom.xml + - name: Build with Maven + run: mvn test --batch-mode --file pom.xml + - name: Publish package + if: ${{ github.event_name == 'push' }} + run: mvn --batch-mode deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +