Skip to content

Update detekt to v1.23.3 #4008

Update detekt to v1.23.3

Update detekt to v1.23.3 #4008

Workflow file for this run

name: build
on:
push:
branches:
- main
tags:
- v**
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 17
- name: Determine Version
run: |
# determine version from tag
export VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
if [[ $VERSION != v* ]]
then
export VERSION=""
echo "Building version-less (master or feature branch)"
else
# make version more Java-friendly by dropping the 'v'
export VERSION=${VERSION:1:${#VERSION}}
echo "Building as ${VERSION}"
fi
# store version in GitHub environment file
echo "version=$VERSION" >> $GITHUB_ENV
- name: Build ${{ env.version }}
uses: gradle/gradle-build-action@v2
with:
arguments: :codyze-cli:build -x check --parallel -Pversion=${{ env.version }}
- name: Push Release Docker Image
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker build -t ghcr.io/fraunhofer-aisec/codyze:latest .
docker tag ghcr.io/fraunhofer-aisec/codyze:latest ghcr.io/fraunhofer-aisec/codyze:${{ env.version }}
docker push ghcr.io/fraunhofer-aisec/codyze:${{ env.version }}
docker push ghcr.io/fraunhofer-aisec/codyze:latest
- name: Create Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
name: ${{ env.version }}
generate_release_notes: true
files: codyze-cli/build/distributions/codyze-cli-${{ env.version }}.zip