-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-from-template-merged
- Loading branch information
Showing
18 changed files
with
1,579 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Ignorefile for broken link check | ||
localhost | ||
mvnrepository.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
name: Check Build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ develop ] | ||
paths-ignore: | ||
- '**.md' | ||
- '.config/**' | ||
- '.github/**' | ||
- '.idea/**' | ||
- 'assets/**' | ||
pull_request: | ||
branches: [ develop ] | ||
paths-ignore: | ||
- '**.md' | ||
- '.config/**' | ||
- '.github/**' | ||
- '.idea/**' | ||
- 'assets/**' | ||
|
||
env: | ||
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} | ||
DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
java: [17, 21] | ||
distribution: [temurin] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ matrix.distribution }} | ||
java-version: ${{ matrix.java }} | ||
cache: 'maven' | ||
|
||
- name: Build with Maven | ||
run: ./mvnw -B clean package | ||
|
||
- name: Check for uncommited changes | ||
run: | | ||
if [[ "$(git status --porcelain)" != "" ]]; then | ||
echo ---------------------------------------- | ||
echo git status | ||
echo ---------------------------------------- | ||
git status | ||
echo ---------------------------------------- | ||
echo git diff | ||
echo ---------------------------------------- | ||
git diff | ||
echo ---------------------------------------- | ||
echo Troubleshooting | ||
echo ---------------------------------------- | ||
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package" | ||
exit 1 | ||
fi | ||
- name: Upload demo files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: demo-files-java-${{ matrix.java }} | ||
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar | ||
if-no-files-found: error | ||
|
||
checkstyle: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} | ||
|
||
strategy: | ||
matrix: | ||
java: [17] | ||
distribution: [temurin] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ matrix.distribution }} | ||
java-version: ${{ matrix.java }} | ||
cache: 'maven' | ||
|
||
- name: Run Checkstyle | ||
run: ./mvnw -B checkstyle:check -P checkstyle -T2C | ||
|
||
pmd: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} | ||
|
||
strategy: | ||
matrix: | ||
java: [17] | ||
distribution: [temurin] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: ${{ matrix.distribution }} | ||
java-version: ${{ matrix.java }} | ||
cache: 'maven' | ||
|
||
- name: Run PMD | ||
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C | ||
|
||
- name: Run CPD (Copy Paste Detector) | ||
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C | ||
|
||
- name: Upload report | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pmd-report | ||
if-no-files-found: ignore | ||
path: | | ||
target/site/*.html | ||
target/site/css/** | ||
target/site/images/logos/maven-feather.png | ||
target/site/images/external.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
env: | ||
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
check-code: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Build with Maven | ||
run: ./mvnw -B clean package | ||
|
||
- name: Check for uncommited changes | ||
run: | | ||
if [[ "$(git status --porcelain)" != "" ]]; then | ||
echo ---------------------------------------- | ||
echo git status | ||
echo ---------------------------------------- | ||
git status | ||
echo ---------------------------------------- | ||
echo git diff | ||
echo ---------------------------------------- | ||
git diff | ||
echo ---------------------------------------- | ||
echo Troubleshooting | ||
echo ---------------------------------------- | ||
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package" | ||
exit 1 | ||
fi | ||
prepare-release: | ||
runs-on: ubuntu-latest | ||
needs: [check-code] | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
- name: Un-SNAP | ||
run: | | ||
mvnwPath=$(readlink -f ./mvnw) | ||
modules=("") # root | ||
modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) | ||
for i in "${modules[@]}" | ||
do | ||
echo "Processing $i/pom.xml" | ||
(cd "$i" && $mvnwPath -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false) | ||
done | ||
- name: Get version | ||
id: version | ||
run: | | ||
version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo "release=$version" >> $GITHUB_OUTPUT | ||
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT | ||
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} | ||
|
||
- name: Commit and Push | ||
run: | | ||
git add -A | ||
git commit -m "Release ${{ steps.version.outputs.release }}" | ||
git push origin | ||
git tag v${{ steps.version.outputs.release }} | ||
git push origin --tags | ||
- name: Create Release | ||
id: create_release | ||
uses: shogo82148/actions-create-release@v1 | ||
with: | ||
tag_name: v${{ steps.version.outputs.release }} | ||
release_name: v${{ steps.version.outputs.release }} | ||
commitish: master | ||
body: | | ||
## [Changelog](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) | ||
See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/${{ github.repository }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. | ||
## Installation | ||
Add the following lines to your pom: | ||
```XML | ||
<dependency> | ||
<groupId>software.xdev</groupId> | ||
<artifactId>${{ env.PRIMARY_MAVEN_MODULE }}</artifactId> | ||
<version>${{ steps.version.outputs.release }}</version> | ||
</dependency> | ||
``` | ||
publish-maven: | ||
runs-on: ubuntu-latest | ||
needs: [prepare-release] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Init Git and pull | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git pull | ||
- name: Set up JDK Apache Maven Central | ||
uses: actions/setup-java@v4 | ||
with: # running setup-java again overwrites the settings.xml | ||
java-version: '17' | ||
distribution: 'temurin' | ||
server-id: ossrh | ||
server-username: MAVEN_CENTRAL_USERNAME | ||
server-password: MAVEN_CENTRAL_TOKEN | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | ||
|
||
- name: Publish to Apache Maven Central | ||
run: ../mvnw -B deploy -Possrh -DskipTests | ||
env: | ||
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} | ||
MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | ||
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} | ||
|
||
publish-pages: | ||
runs-on: ubuntu-latest | ||
needs: [prepare-release] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Init Git and pull | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git pull | ||
- name: Setup - Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Build site | ||
run: ../mvnw -B compile site -DskipTests -T2C | ||
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} | ||
|
||
- name: Deploy to Github pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site | ||
|
||
after-release: | ||
runs-on: ubuntu-latest | ||
needs: [publish-maven] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Init Git and pull | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git pull | ||
- name: Inc Version and SNAP | ||
run: | | ||
mvnwPath=$(readlink -f ./mvnw) | ||
modules=("") # root | ||
modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) | ||
for i in "${modules[@]}" | ||
do | ||
echo "Processing $i/pom.xml" | ||
(cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true -DupdateMatchingVersions=false) | ||
done | ||
- name: Git Commit and Push | ||
run: | | ||
git add -A | ||
git commit -m "Preparing for next development iteration" | ||
git push origin | ||
- name: pull-request | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh_pr_up() { | ||
gh pr create "$@" || gh pr edit "$@" | ||
} | ||
gh_pr_up -B "develop" \ | ||
--title "Sync back" \ | ||
--body "An automated PR to sync changes back" |
Oops, something went wrong.