Skip to content

[Gradle Release Plugin] - pre tag commit: '1.1.28'. #1899

[Gradle Release Plugin] - pre tag commit: '1.1.28'.

[Gradle Release Plugin] - pre tag commit: '1.1.28'. #1899

Workflow file for this run

name: Java CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.11
uses: actions/setup-java@v1
with:
java-version: 1.11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Log into registry
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
run: echo "${{ secrets.DOCKER_HUB_SECRET }}" | docker login --username chrbayer84 --password-stdin
- name: Build with Gradle
run: ./gradlew build --info --stacktrace
- name: Publish Failure Test Report
if: ${{ failure() }} # doesn't run unless it specifically grabs the failure condition of the previous step..
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Extract project version
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: echo "::set-env name=GRADLE_PROJECT_VERSION::`./gradlew properties|grep version |cut -c 10-`"
- name: Show project version
run: echo "$GRADLE_PROJECT_VERSION"
- name: Publish Docker container
# run: ./gradlew -PdockerRepo=docker.pkg.github.com/${{ github.repository }}/ -x test publish --info
run: ./gradlew -PdockerRepo=chrbayer84/ -x test publish --info
- name: scan docker image
uses: azure/container-scan@v0
with:
image-name: chrbayer84/carbonj:${{ env.GRADLE_PROJECT_VERSION }}
severity-threshold: CRITICAL
# - name: Push image
# severity-threshold: CRITICAL
# run-quality-checks: false
# run: |
# IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
#
# # Strip git ref prefix from version
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
#
# # Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
#
# # Use Docker `latest` tag convention
# [ "$VERSION" == "master" ] && VERSION=latest
#
# echo IMAGE_ID=$IMAGE_ID
# echo VERSION=$VERSION
#
# docker tag image $IMAGE_ID:$VERSION
# docker push $IMAGE_ID:$VERSION