Skip to content

Commit

Permalink
Merge branch 'release/34.x'
Browse files Browse the repository at this point in the history
* release/34.x:
  No issue: Cancel running builds when a new one on the same branch is triggered
  No issue: Try deploying Maven artifacts
  No issue: Try deploying Maven artifacts
  No issue: Try deploying Maven artifacts
  No issue: Try deploying Maven artifacts
  • Loading branch information
reckart committed Dec 20, 2024
2 parents dffea30 + 64b1f92 commit 9d81dde
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
Expand All @@ -14,6 +6,10 @@ on:
pull_request:
branches: [ "main", "release/**" ]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
Expand All @@ -36,6 +32,14 @@ jobs:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: maven
server-id: ukp-oss-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.9

- name: Set up cache date
run: echo "CACHE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
Expand All @@ -50,9 +54,18 @@ jobs:
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn --no-transfer-progress -B clean verify --file pom.xml
if: "!(matrix.os == 'ubuntu-latest' && github.event_name != 'pull_request')"
run: mvn --show-version --batch-mode --no-transfer-progress clean verify

- name: Build with Maven and publish artifacts
if: matrix.os == 'ubuntu-latest' && github.event_name != 'pull_request'
env:
# `MAVEN_USERNAME` and `MAVEN_PASSWORD` are used in `~/.m2/settings.xml` created by `setup-java` action
MAVEN_USERNAME: ${{ secrets.UKP_MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.UKP_MAVEN_TOKEN }}
run: mvn --show-version --batch-mode --errors --no-transfer-progress -DdeployAtEnd=true -DskipTests clean deploy

- name: Upload Artifacts
- name: Capture build artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
<id>ukp-oss</id>
<url>https://zoidberg.ukp.informatik.tu-darmstadt.de/artifactory/public-ukp-releases-local</url>
</repository>
<snapshotRepository>
<id>ukp-oss-snapshots</id>
<url>https://zoidberg.ukp.informatik.tu-darmstadt.de/artifactory/public-ukp-snapshots-local</url>
</snapshotRepository>
</distributionManagement>

<properties>
Expand Down

0 comments on commit 9d81dde

Please sign in to comment.