diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index c28c5eac..29ebdae7 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -19,9 +19,6 @@ on: - '.idea/**' - 'assets/**' -env: - DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo - jobs: build: runs-on: ubuntu-latest @@ -69,13 +66,6 @@ jobs: exit 1 fi - - name: Upload demo files - uses: actions/upload-artifact@v7 - 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/') }} @@ -148,10 +138,10 @@ jobs: ${{ runner.os }}-pmd- - name: Run PMD - run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C + run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -T2C - name: Run CPD (Copy Paste Detector) - run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C + run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -T2C - name: Upload report if: ${{ !cancelled() }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 008ec2ca..7f9ada7b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,13 +4,6 @@ on: push: branches: [ master ] -env: - PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} - -permissions: - contents: write - pull-requests: write - # DO NOT RESTORE CACHE for critical release steps to prevent a (extremely unlikely) scenario # where a supply chain attack could be achieved due to poisoned cache jobs: @@ -37,7 +30,8 @@ jobs: ${{ runner.os }}-mvn-build- - name: Build with Maven - run: ./mvnw -B clean package -T2C + run: ../mvnw -B clean package -T2C + working-directory: src - name: Check for uncommited changes run: | @@ -61,6 +55,8 @@ jobs: runs-on: ubuntu-latest needs: [check-code] timeout-minutes: 10 + permissions: + contents: write outputs: upload_url: ${{ steps.create-release.outputs.upload_url }} steps: @@ -77,10 +73,9 @@ jobs: - name: Get version id: version run: | - version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) + version=$(./mvnw -B 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: | @@ -106,7 +101,7 @@ jobs: ```XML software.xdev - ${{ env.PRIMARY_MAVEN_MODULE }} + ${{ github.event.repository.name }} ${{ steps.version.outputs.release }} ``` @@ -130,13 +125,13 @@ jobs: distribution: 'temurin' java-version: '17' server-id: github-central - server-password: PACKAGES_CENTRAL_TOKEN - gpg-passphrase: MAVEN_GPG_PASSPHRASE + server-password-env-var: PACKAGES_CENTRAL_TOKEN + gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once - name: Publish to GitHub Packages Central - run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + run: ../mvnw -B deploy -P publish -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central + working-directory: src env: PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} @@ -147,19 +142,19 @@ jobs: distribution: 'temurin' java-version: '17' server-id: sonatype-central-portal - server-username: MAVEN_CENTRAL_USERNAME - server-password: MAVEN_CENTRAL_TOKEN - gpg-passphrase: MAVEN_GPG_PASSPHRASE + server-username-env-var: MAVEN_CENTRAL_USERNAME + server-password-env-var: MAVEN_CENTRAL_TOKEN + gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE - name: Publish to Central Portal - run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests + run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal + working-directory: src env: MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - publish-pages: + build-pages: runs-on: ubuntu-latest needs: [prepare-release] timeout-minutes: 15 @@ -188,20 +183,69 @@ jobs: ${{ runner.os }}-mvn-build- - name: Build site - run: ../mvnw -B compile site -DskipTests -T2C - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + run: ../mvnw -B compile site -P site -T2C + working-directory: src + + - name: Aggregate site + run: | + # Compile is required, otherwise dep resolution failure + echo "Looking up modules" + module_dirs=($(../mvnw -B -q --also-make compile exec:exec -Dexec.executable="pwd" -Dmaven.main.skip)) + base_module_full="${module_dirs[0]}" + + echo "Found modules - Src: $base_module_full" + + base_cut_away_length=$((${#base_module_full}+1)) + + echo "BasePathLengthToCutAway: $base_cut_away_length" - - name: Deploy to Github pages - uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4 + is_first=true + for full_module_path in "${module_dirs[@]}" + do + if [ $is_first = true ]; then + echo "Skipping initial/base module" + is_first=false + continue + fi + + m=${full_module_path:$base_cut_away_length} + + echo "$m/target/site -> ./target/$m" + mkdir -p ./target/$m + cp -r $m/target/site ./target/$m + done + working-directory: src + + - name: Upload pages artifact + uses: actions/upload-pages-artifact@v5 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site - force_orphan: true + path: src/target/site + + deploy-pages: + runs-on: ubuntu-latest + needs: [build-pages] + timeout-minutes: 10 + concurrency: + group: 'pages' + cancel-in-progress: false + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 after-release: runs-on: ubuntu-latest needs: [publish-maven] timeout-minutes: 10 + permissions: + contents: write + pull-requests: write steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 9f665060..382f6567 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -3,9 +3,6 @@ name: Test Deployment on: workflow_dispatch: -env: - PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} - jobs: publish-maven: runs-on: ubuntu-latest @@ -19,13 +16,13 @@ jobs: distribution: 'temurin' java-version: '17' server-id: github-central - server-password: PACKAGES_CENTRAL_TOKEN - gpg-passphrase: MAVEN_GPG_PASSPHRASE + server-password-env-var: PACKAGES_CENTRAL_TOKEN + gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once - name: Publish to GitHub Packages Central - run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + run: ../mvnw -B deploy -P publish -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central + working-directory: src env: PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} @@ -36,13 +33,13 @@ jobs: distribution: 'temurin' java-version: '17' server-id: sonatype-central-portal - server-username: MAVEN_CENTRAL_USERNAME - server-password: MAVEN_CENTRAL_TOKEN - gpg-passphrase: MAVEN_GPG_PASSPHRASE + server-username-env-var: MAVEN_CENTRAL_USERNAME + server-password-env-var: MAVEN_CENTRAL_TOKEN + gpg-passphrase-env-var: MAVEN_GPG_PASSPHRASE - name: Publish to Central Portal - run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests - working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal + working-directory: src env: MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }} diff --git a/demos/pom.xml b/demos/pom.xml new file mode 100644 index 00000000..f6ea5e80 --- /dev/null +++ b/demos/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + + software.xdev + root + 1.0.0-SNAPSHOT + + + demos + pom + + + template-placeholder-demo + + diff --git a/template-placeholder-demo/pom.xml b/demos/template-placeholder-demo/pom.xml similarity index 68% rename from template-placeholder-demo/pom.xml rename to demos/template-placeholder-demo/pom.xml index 06fc3187..4699caeb 100644 --- a/template-placeholder-demo/pom.xml +++ b/demos/template-placeholder-demo/pom.xml @@ -6,26 +6,14 @@ software.xdev - template-placeholder-root + demos 1.0.0-SNAPSHOT template-placeholder-demo - 1.0.0-SNAPSHOT jar - - XDEV Software - https://xdev.software - - - 17 - ${javaVersion} - - UTF-8 - UTF-8 - software.xdev.Application @@ -41,17 +29,6 @@ ${project.artifactId} - - org.apache.maven.plugins - maven-compiler-plugin - 3.15.0 - - ${maven.compiler.release} - - -proc:none - - - org.apache.maven.plugins maven-assembly-plugin diff --git a/pom.xml b/pom.xml index a8116cfe..57ce9268 100644 --- a/pom.xml +++ b/pom.xml @@ -1,29 +1,52 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + child.project.url.inherit.append.path="false"> 4.0.0 software.xdev - template-placeholder-root + root 1.0.0-SNAPSHOT pom - - - XDEV Software - https://xdev.software - + https://github.com/xdev-software/template-placeholder - template-placeholder - template-placeholder-demo + src + demos + 17 + ${javaVersion} + UTF-8 UTF-8 + + https://github.com/xdev-software/template-placeholder + scm:git:https://github.com/xdev-software/template-placeholder.git + + + 2026 + + + XDEV Software + https://xdev.software + + + + + XDEV Software + XDEV Software + https://xdev.software + + + Apache-2.0 @@ -32,6 +55,24 @@ + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.16.0 + + ${maven.compiler.release} + + -proc:none + + + + + + + checkstyle diff --git a/renovate.json5 b/renovate.json5 index 1e1f3c05..d5dd7dd9 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -14,8 +14,13 @@ }, { "description": "Ignore project internal dependencies", - "packagePattern": "^software.xdev:template-placeholder", - "datasources": [ + "matchPackagePatterns": [ + "^software.xdev.*:template-placeholder", + "^software.xdev.*:demos", + "^software.xdev.*:src", + "^software.xdev.*:root" + ], + "matchDatasources": [ "maven" ], "enabled": false @@ -25,7 +30,7 @@ "matchPackagePatterns": [ "^net.sourceforge.pmd" ], - "datasources": [ + "matchDatasources": [ "maven" ], "groupName": "net.sourceforge.pmd" diff --git a/template-placeholder/pom.xml b/src/pom.xml similarity index 57% rename from template-placeholder/pom.xml rename to src/pom.xml index f4755caa..b1bb989a 100644 --- a/template-placeholder/pom.xml +++ b/src/pom.xml @@ -4,50 +4,18 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - software.xdev - template-placeholder - 1.0.0-SNAPSHOT - jar + + software.xdev + root + 1.0.0-SNAPSHOT + - template-placeholder - template-placeholder - https://github.com/xdev-software/template-placeholder + src + pom - - https://github.com/xdev-software/template-placeholder - scm:git:https://github.com/xdev-software/template-placeholder.git - - - 2023 - - - XDEV Software - https://xdev.software - - - - - XDEV Software - XDEV Software - https://xdev.software - - - - - - Apache-2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - 17 - ${javaVersion} - - UTF-8 - UTF-8 - + + template-placeholder + @@ -62,6 +30,44 @@ maven-project-info-reports-plugin 3.9.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.12.0 + + + org.apache.maven.plugins + maven-source-plugin + 3.4.0 + + + + org.apache.maven.plugins + maven-install-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-deploy-plugin + 3.2.0 + + + + org.codehaus.mojo + flatten-maven-plugin + 1.8.0 + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.8 + + + org.sonatype.central + central-publishing-maven-plugin + 0.11.0 + @@ -94,21 +100,9 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.15.0 - - ${maven.compiler.release} - - -proc:none - - - org.apache.maven.plugins maven-javadoc-plugin - 3.12.0 attach-javadocs @@ -126,7 +120,6 @@ org.apache.maven.plugins maven-source-plugin - 3.4.0 attach-sources @@ -140,14 +133,85 @@ + + do-not-publish-this + + + skip-publish.marker + + + + + + org.codehaus.mojo + flatten-maven-plugin + + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + + + org.apache.maven.plugins + maven-source-plugin + + true + + + + + maven-install-plugin + + true + + + + maven-deploy-plugin + + true + + + + + org.apache.maven.plugins + maven-gpg-plugin + + true + + + + org.sonatype.central + central-publishing-maven-plugin + + true + + + + + + + pmd + + true + + publish + + true + true + org.codehaus.mojo flatten-maven-plugin - 1.8.0 ossrh @@ -164,7 +228,6 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.8 sign-artifacts @@ -193,7 +256,6 @@ org.sonatype.central central-publishing-maven-plugin - 0.11.0 true sonatype-central-portal @@ -204,76 +266,11 @@ - checkstyle - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.6.0 - - - com.puppycrawl.tools - checkstyle - 14.1.0 - - - - ../.config/checkstyle/checkstyle.xml - true - - - - - check - - - - - - - - - pmd - - - - org.apache.maven.plugins - maven-pmd-plugin - 3.28.0 - - true - true - true - - ../.config/pmd/java/ruleset.xml - - - - - net.sourceforge.pmd - pmd-core - 7.27.0 - - - net.sourceforge.pmd - pmd-java - 7.27.0 - - - - - - - - - - org.apache.maven.plugins - maven-jxr-plugin - 3.6.0 - - - + site + + true + true + diff --git a/src/skip-publish.marker b/src/skip-publish.marker new file mode 100644 index 00000000..e69de29b diff --git a/src/template-placeholder/pom.xml b/src/template-placeholder/pom.xml new file mode 100644 index 00000000..4df605f9 --- /dev/null +++ b/src/template-placeholder/pom.xml @@ -0,0 +1,19 @@ + + + 4.0.0 + + + software.xdev + src + 1.0.0-SNAPSHOT + + + template-placeholder + jar + + template-placeholder + template-placeholder + +