Skip to content

Adjustments to Detekt ruleset. #136

Adjustments to Detekt ruleset.

Adjustments to Detekt ruleset. #136

Workflow file for this run

##
# This file is part of the pl.wrzasq.parent.
#
# @license http://mit-license.org/ The MIT license
# @copyright 2021, 2023 - 2024 © by Rafał Wrzeszcz - Wrzasq.pl.
##
on:
push:
tags-ignore: "**"
branches: "**"
pull_request:
branches: "**"
schedule:
-
cron: "0 3 * * 0"
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]') || (github.event_name == 'schedule')"
runs-on: "ubuntu-24.04"
strategy:
matrix:
java:
- "17"
- "21"
steps:
-
uses: "actions/[email protected]"
-
uses: "actions/[email protected]"
with:
java-version: "${{ matrix.java }}"
distribution: "zulu"
-
uses: "actions/[email protected]"
with:
path: "~/.m2/repository/"
key: "${{ runner.os }}-m2-${{ matrix.java }}"
-
run: "mvn -B -e verify site"
release:
if: "(github.event_name == 'push') && (github.event.ref == 'refs/heads/master')"
runs-on: "ubuntu-24.04"
needs: "build"
steps:
# workspace preparation
-
uses: "actions/[email protected]"
-
uses: "actions/[email protected]"
with:
java-version: "17"
distribution: "zulu"
server-id: "ossrh"
server-username: "OSSRH_USERNAME"
server-password: "OSSRH_PASSWORD"
gpg-private-key: "${{ secrets.GPG_PRIVATE_KEY }}"
gpg-passphrase: "MAVEN_GPG_PASSPHRASE"
-
uses: "actions/[email protected]"
with:
path: "~/.m2/repository/"
key: "${{ runner.os }}-m2-17"
# Git setup
-
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
# first make current version release
-
run: "mvn -B versions:set versions:commit -DremoveSnapshot=true"
-
run: |
git add -u
git commit -m "[skip ci] Automated release release."
# perform a release
-
run: "mvn -B -e clean deploy site -P deploy"
env:
GITHUB_ACTOR: "${{ secrets.GITHUB_ACTOR }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
OSSRH_USERNAME: "${{ secrets.OSSRH_USERNAME }}"
OSSRH_PASSWORD: "${{ secrets.OSSRH_PASSWORD }}"
MAVEN_GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"
# deploy site as GitHub Pages - we previously had it integrated with Maven build in `site-deploy` phase
# but net.trajano.wagon:wagon-git has a lot of problems with handling newer SSH connection protocols
# and official GitHub Maven Pages plugin uses low-level Git API and exceeds rate limit easily
-
# in other projects we can use generic form but in pl.wrzasq.parent relations are more complex
run: |
cp -r parent-detekt/target/site target/site/parent-detekt
cp -r parent-generic/target/site target/site/parent-generic
cp -r parent-nativelambda-plugin/target/site target/site/parent-generic/parent-nativelambda-plugin
cp -r parent-opensource/target/site target/site/parent-generic/parent-opensource
-
uses: "peaceiris/[email protected]"
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
publish_dir: "./target/site/"
# now create a new version commit
-
run: "mvn -B build-helper:parse-version versions:set versions:commit -DnewVersion=\"\\${semver.majorVersion}.\\${semver.minorVersion}.\\${semver.nextIncrementalVersion}-SNAPSHOT\""
-
run: |
git add -u
git commit -m "[skip ci] New version bump."
-
uses: "ad-m/[email protected]"
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
branch: "${{ github.ref }}"
-
id: "tag"
run: "echo ref=$(git describe --abbrev=0) >> $GITHUB_OUTPUT"
-
uses: "ncipollo/[email protected]"
with:
tag: "${{ steps.tag.outputs.ref }}"
body: "${{ github.event.head_commit.message }}"
token: "${{ secrets.GITHUB_TOKEN }}"
artifacts: "*/target/*.jar"