Skip to content

Merge pull request #1400 from DependencyTrack/update-config-docs #885

Merge pull request #1400 from DependencyTrack/update-config-docs

Merge pull request #1400 from DependencyTrack/update-config-docs #885

Workflow file for this run

# This file is part of Dependency-Track.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.
name: Publish Jar
on:
push:
branches:
- main
- "feature-**"
permissions: { }
jobs:
publish-container-image:
name: Publish Jar based Container Images
runs-on: ubuntu-latest
permissions:
actions: write # Required to trigger e2e workflow
packages: write # Required to push images to ghcr.io
timeout-minutes: 15
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7
- name: Set up JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # tag=v4.2.1
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Set up QEMU
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # tag=v3.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # tag=v3.4.0
with:
install: true
- name: Docker login
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # tag=v3.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine Container Tags
id: determine-container-tags
run: |-
TAG=""
ADDITIONAL_TAGS=""
if [[ $GITHUB_REF_NAME == feature-* ]]; then
TAG="${GITHUB_REF_NAME,,}"
else
TAG="$(yq -p=xml '.project.version' pom.xml)"
ADDITIONAL_TAGS="snapshot"
fi
echo "tag=${TAG}" >> $GITHUB_OUTPUT
echo "additional-tags=${ADDITIONAL_TAGS}" >> $GITHUB_OUTPUT
- name: Build and push container images
run: |-
mvn -B --no-transfer-progress clean install -DskipTests \
-Dquarkus.container-image.registry=ghcr.io \
-Dquarkus.container-image.group=${GITHUB_REPOSITORY_OWNER,,} \
-Dquarkus.container-image.tag=${{ steps.determine-container-tags.outputs.tag }} \
-Dquarkus.container-image.additional-tags=${{ steps.determine-container-tags.outputs.additional-tags }} \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=true \
-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64
- name: Run end-to-end tests
env:
GH_TOKEN: ${{ github.token }}
run: |-
gh workflow run e2e-test.yml \
-f hyades-version=${{ startsWith(steps.determine-container-tags.outputs.tag, 'feature-') && steps.determine-container-tags.outputs.tag || 'snapshot' }}