Skip to content

Release

Release #9

Workflow file for this run

name: Release
on:
workflow_dispatch: { }
permissions: { }
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write # Required to create releases
packages: write # Required to push images to ghcr.io
if: "${{ github.repository_owner == 'DependencyTrack' }}"
steps:
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v4.1.1
with:
persist-credentials: false
- name: Set up JDK
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # tag=v3.13.0
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # tag=v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # tag=v3.0.0
with:
install: true
- name: Docker login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # tag=v3.0.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Perform Release
run: |-
git config user.name "dependencytrack-bot"
git config user.email "106437498+dependencytrack-bot@users.noreply.github.com"
BUILD_ARGS=(
'-Dcheckstyle.skip'
'-DskipTests'
'-Dquarkus.container-image.registry=ghcr.io'
"-Dquarkus.container-image.group=${GITHUB_REPOSITORY_OWNER,,}"
'-Dquarkus.container-image.additional-tags=latest'
'-Dquarkus.container-image.build=true'
'-Dquarkus.container-image.push=true'
'-Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64'
)
mvn -B release:prepare \
-DpreparationGoals="clean cyclonedx:makeBom verify" \
-Darguments="${BUILD_ARGS[*]}" \
-DpushChanges=false
- name: Push Changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.BOT_RELEASE_TOKEN }}
tags: true
- name: Determine Release Tag
id: determine-release-tag
run: |-
TAG_NAME="$(sed -nr 's/^scm.tag=(v[0-9.]+)$/\1/p' release.properties)"
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT
- name: Create GitHub Release
env:
GITHUB_TOKEN: "${{ secrets.BOT_RELEASE_TOKEN }}"
run: |-
gh release create "${{ steps.determine-release-tag.outputs.TAG_NAME }}" \
--target ${{ github.ref_name }} \
--verify-tag \
--generate-notes
- name: Upload BOMs to GitHub Release
env:
GITHUB_TOKEN: "${{ secrets.BOT_RELEASE_TOKEN }}"
run: |-
gh release upload "${{ steps.determine-release-tag.outputs.TAG_NAME }}" \
./*/target/*.cdx.json --clobber