ArDoCo Deployment #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ArDoCo Deployment | |
on: | |
workflow_dispatch: | |
inputs: | |
release-version: | |
type: string | |
description: The version for release (Tag in the Repositories without heading 'v'). E.g., "1.2.3" | |
required: true | |
env: | |
ARDOCO_VERSION: "v${{ github.event.inputs.release-version }}" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build image | |
run: docker build . --file Dockerfile --build-arg="ARDOCO_VERSION=v${{ github.event.inputs.release-version }}" --tag "ghcr.io/ardoco/suite:v${{ github.event.inputs.release-version }}" | |
- name: Login to Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin | |
- name: Push Image with Version and Latest Tag | |
run: | | |
docker push "ghcr.io/ardoco/suite:v${{ github.event.inputs.release-version }}" | |
docker tag "ghcr.io/ardoco/suite:v${{ github.event.inputs.release-version }}" "ghcr.io/ardoco/suite:latest" | |
docker push "ghcr.io/ardoco/suite:latest" | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Java without Cache | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- name: Clone ArDoCo Projects | |
shell: bash | |
run: | | |
git clone --depth 1 -b ${ARDOCO_VERSION} https://github.com/ArDoCo/Core.git | |
git clone --depth 1 -b ${ARDOCO_VERSION} https://github.com/ArDoCo/TLR.git | |
git clone --depth 1 -b ${ARDOCO_VERSION} https://github.com/ArDoCo/InconsistencyDetection.git | |
- name: Check Version of ArDoCo Projects | |
shell: bash | |
run: | | |
for project in Core TLR InconsistencyDetection; do | |
cd $project | |
echo "Checking $project" | |
FOUND_VERSION=$( (mvn dependency:tree -DincludeScope=test | sort | grep -E "io.github.ardoco.(core|tlr|id|lissa)" | grep -oP ':\K\d+\.\d+\.\d+(-\w+)?' | awk '!seen[$0]++') || true) | |
echo "$FOUND_VERSION" | |
if [[ $FOUND_VERSION == *"SNAPSHOT"* ]]; then | |
echo "The version of ArDoCo Projects is a SNAPSHOT version." | |
exit 1 | |
fi | |
if [ "v${FOUND_VERSION}" != "${ARDOCO_VERSION}" ]; then | |
echo "The version of ArDoCo Projects is not the same as the release version." | |
echo "Found: ${FOUND_VERSION}, Expected: ${ARDOCO_VERSION}" | |
exit 1 | |
fi | |
cd .. | |
done | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_KEY }} | |
- name: Test ArDoCo Projects | |
shell: bash | |
run: | | |
cd Core | |
mvn -P deployment -DskipTests install | |
cd ../TLR | |
mvn -P deployment -DskipTests install | |
cd ../InconsistencyDetection | |
mvn -P deployment -DskipTests install | |
echo "Verify the Projects" | |
cd ../Core | |
mvn -B verify | |
cd ../TLR | |
mvn -B verify | |
cd ../InconsistencyDetection | |
mvn -B -DskipITs verify | |
- name: Set maven settings.xml | |
uses: whelk-io/maven-settings-xml-action@v21 | |
with: | |
servers: '[{ "id": "ossrh", "username": "${{ secrets.OSSRH_USER }}", "password": "${{ secrets.OSSRH_TOKEN }}" }]' | |
- name: Deploy ArDoCo Projects | |
shell: bash | |
run: | | |
cd Core | |
mvn clean | |
mvn -B -DskipTests -P deployment deploy | |
cd ../TLR | |
mvn clean | |
mvn -B -DskipTests -P deployment deploy | |
cd ../InconsistencyDetection | |
mvn clean | |
mvn -B -DskipTests -P deployment deploy |