diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index c28c5ea..29ebdae 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 008ec2c..ea67f35 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 -P site -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/site/$m" + mkdir -p ./target/site/$m + cp -r $m/target/site/. ./target/site/$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 9f66506..382f656 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/.run/Run Demo.run.xml b/.run/Run Demo.run.xml index ff66806..b1b6909 100644 --- a/.run/Run Demo.run.xml +++ b/.run/Run Demo.run.xml @@ -2,7 +2,6 @@