Skip to content

Merge pull request #1578 from DependencyTrack/dependabot/maven/quarku… #1021

Merge pull request #1578 from DependencyTrack/dependabot/maven/quarku…

Merge pull request #1578 from DependencyTrack/dependabot/maven/quarku… #1021

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@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2
- name: Set up JDK
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # tag=v4.5.0
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # tag=v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # tag=v3.7.1
with:
install: true
- name: Docker login
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # tag=v3.3.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' }}