Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/server-web-api-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ jobs:
java-version: 1.8
- name: Build DIEF with Maven
run: mvn clean install -Dskip=true -DskipTests -Dmaven.source.skip=true -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.count=3

- name: Debug List Maven repo and parent POM
run: |
sed -n '1,120p' ~/.m2/repository/org/dbpedia/extraction/core/4.2-SNAPSHOT/core-4.2-SNAPSHOT.pom | grep -n '<parent>\|<version>'
echo "=== Check installed POMs for unresolved \${revision} in <parent><version> ==="
grep -n "<parent>" ~/.m2/repository/org/dbpedia/extraction/*/4.2-SNAPSHOT/*.pom || true
grep -n "<version>\${revision}</version>" ~/.m2/repository/org/dbpedia/extraction/*/4.2-SNAPSHOT/*.pom || true

echo "Listing parent POM and Maven repo contents:"
ls -l ../pom.xml || ls -l ../../pom.xml || true
ls -lR ~/.m2/repository/org/dbpedia/extraction || true

- name: Debug Print effective POM for server module
run: |
cd server
mvn help:effective-pom -Doutput=effective-pom.xml
cat effective-pom.xml
cd ..
- name: Start DBpedia Server
run: |
cd server
Expand Down
45 changes: 33 additions & 12 deletions .github/workflows/snapshot_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,40 @@ jobs:
</settings>
EOF

- name: Compute Maven-safe REVISION
shell: bash
run: |
set -euo pipefail

sanitize() {
# lowercase; allow only [a-z0-9.-]; collapse dashes; trim edges
echo "$1" \
| tr '[:upper:]' '[:lower:]' \
| sed -E 's/[^a-z0-9.-]+/-/g; s/-+/-/g; s/^-+//; s/-+$//'
}

if [[ "${GITHUB_REF}" == refs/pull/* ]]; then
# e.g. refs/pull/42/merge -> pr-42-SNAPSHOT
pr_num="$(echo "${GITHUB_REF}" | sed -E 's#refs/pull/([0-9]+).*#\1#')"
base="pr-${pr_num}"
else
# e.g. refs/heads/feature/foo -> feature-foo-SNAPSHOT
base="${GITHUB_REF##*/}"
fi

safe_base="$(sanitize "${base}")"
[[ -z "${safe_base}" ]] && safe_base="build"

REVISION="${safe_base}-SNAPSHOT"
echo "Using Maven revision: ${REVISION}"
echo "REVISION=${REVISION}" >> "$GITHUB_ENV"

- name: Deploy Snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }} # expands to "owner/repo"
REPO: ${{ github.repository }}
run: |
# Example version names:
# For branch 'master': master-SNAPSHOT
# For branch 'feature/foo': feature/foo-SNAPSHOT
# For PR #42: pr-42-SNAPSHOT
if [[ "${GITHUB_REF}" == refs/pull/* ]]; then
REVISION="pr-${GITHUB_REF#refs/pull/}-SNAPSHOT"
else
REVISION="${GITHUB_REF##*/}-SNAPSHOT"
fi
echo "Deploying to: https://maven.pkg.github.com/${REPO} with revision: $REVISION"
mvn deploy -DskipTests -Dgithub.repo.url="https://maven.pkg.github.com/${REPO}" -Drevision="$REVISION"
echo "Deploying to https://maven.pkg.github.com/${REPO} with revision ${REVISION}"
mvn deploy -DskipTests \
-Dgithub.repo.url="https://maven.pkg.github.com/${REPO}" \
-Drevision="${REVISION}"
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Drevision=4.2-SNAPSHOT
1 change: 1 addition & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<groupId>org.dbpedia</groupId>
<artifactId>extraction</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>org.dbpedia.extraction</groupId>
Expand Down
1 change: 1 addition & 0 deletions dump/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<groupId>org.dbpedia</groupId>
<artifactId>extraction</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>org.dbpedia.extraction</groupId>
Expand Down
1 change: 1 addition & 0 deletions scripts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<groupId>org.dbpedia</groupId>
<artifactId>extraction</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>org.dbpedia.extraction</groupId>
Expand Down
1 change: 1 addition & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<groupId>org.dbpedia</groupId>
<artifactId>extraction</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>org.dbpedia.extraction</groupId>
Expand Down
Loading