Skip to content

Bump json from 20180813 to 20230227 in /analyzer/license-detector #315

Bump json from 20180813 to 20230227 in /analyzer/license-detector

Bump json from 20180813 to 20230227 in /analyzer/license-detector #315

name: Build and push the license detector Docker image
on:
push:
branches:
- develop
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
IMAGE_NAME: fasten.license.detector.plugin
jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
runs-on: ubuntu-18.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'temurin'
server-id: github # Value of distributionManagement/repository/id
settings-path: ${{ github.workspace }} # location of settings.xml
- name: Build jar # This includes integration tests # FIXME Skipping https://github.com/fasten-project/fasten/issues/293
#run: mvn clean install --projects server,:license-detector --also-make -Dtest=\!MergerEfficiencyTests#localMergerEfficiencyTest
#run : mvn clean install -pl analyzer/license-detector/
run: mvn -B -ntp clean install -s ${{ github.workspace }}/settings.xml
env:
# auth necessary to access GitHub Maven registries
GITHUB_TOKEN: ${{ github.token }}
- name: Build image # JARs are not generated by this docker build target, but by the previous CI step
run: DOCKER_BUILDKIT=1 docker build --tag $IMAGE_NAME --file docker/license-detector/Dockerfile --target package-ci .
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# If a tag is being pushed
if [[ "${{ github.ref }}" == "refs/tags/"* ]]
then
# Strip "v" prefix from tag name
VERSION=$(echo $VERSION | sed -e 's/^v//')
else
VERSION=${GITHUB_SHA::8}
fi
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
# Push images
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
# Use Docker `latest` tag convention
docker tag $IMAGE_NAME $IMAGE_ID:latest
docker push $IMAGE_ID:latest