docs: add changelog entry for java distribution #144
This file contains hidden or 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
| --- | |
| name: "ci_checks" | |
| on: | |
| pull_request: null | |
| push: | |
| branches: | |
| - "main" | |
| - "feature/move-to-java-binary-releasing" | |
| workflow_dispatch: | |
| inputs: | |
| force_gradle_cache_clean: | |
| description: "Force gradle cache clean" | |
| required: false | |
| default: "false" | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| jobs: | |
| gradleCheck: | |
| name: "run checks using gradlew" | |
| runs-on: "ubuntu-latest" | |
| outputs: | |
| RELEASE_VERSION: ${{ steps.get_version.outputs.VERSION }} | |
| env: | |
| SEGMENT_DOWNLOAD_TIMEOUT_MINS: "15" | |
| steps: | |
| - name: "Checkout" | |
| uses: "actions/checkout@v4" | |
| with: | |
| fetch-depth: 0 | |
| - name: "Install JDK 21" | |
| uses: "actions/setup-java@v4" | |
| with: | |
| distribution: "zulu" | |
| java-version: 21 | |
| - name: "Install Node.js" | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "lts/jod" # 22 | |
| - name: "debug node" | |
| run: "node --version && npm --version" | |
| - name: "Setup Gradle" | |
| uses: "gradle/actions/setup-gradle@v4" | |
| with: | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| - name: "Nuke gradle cache" | |
| if: "${{ github.event.inputs.force_gradle_cache_clean == 'true' }}" | |
| run: "rm -rf ~/.gradle/caches" | |
| - name: "Run check on build-logic subproject" | |
| run: "./gradlew :build-logic:check --no-configuration-cache" | |
| - name: "Run check on project" | |
| run: "./gradlew generateUsage && ./gradlew check" | |
| - name: "Create dist zip (java binary)" | |
| run: "./gradlew distZip" | |
| - name: "upload dist-zip" # for debugging | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "dist-zip" | |
| path: app/build/distributions/spotless-cli-*.zip | |
| retention-days: 7 | |
| if-no-files-found: "error" | |
| - name: "Get version and set to output" | |
| id: get_version | |
| run: echo "VERSION=$(./gradlew changelogPrintCurrentVersion --quiet)" >> "$GITHUB_OUTPUT" | |
| - name: "junit result" | |
| uses: "mikepenz/action-junit-report@v5" | |
| if: "always()" | |
| with: | |
| check_name: "JUnit Report" | |
| report_paths: "**/build/test-results/tes*/*.xml" # multiple test tasks | |
| dryRunRelease: | |
| name: "dry run release" | |
| needs: ["gradleCheck"] | |
| strategy: | |
| matrix: | |
| platform: | |
| - name: "linux-x86_64" | |
| runner: "ubuntu-latest" | |
| - name: "windows-x86_64" | |
| runner: "windows-latest" | |
| runs-on: "${{ matrix.platform.runner }}" | |
| steps: | |
| - name: "Checkout" | |
| uses: "actions/checkout@v4" | |
| with: | |
| fetch-depth: 0 | |
| - name: "Install JDK 21" | |
| uses: "actions/setup-java@v4" | |
| with: | |
| distribution: "zulu" | |
| java-version: 21 | |
| - name: "Setup Gradle" | |
| uses: "gradle/actions/setup-gradle@v4" | |
| - name: "Retrieve dist-zip" | |
| uses: "actions/download-artifact@v5" | |
| with: | |
| name: "dist-zip" | |
| path: "app/build/distributions" | |
| - name: "Prepare jreleaser for distribution" | |
| run: "./gradlew prepareJReleaserConfig" | |
| env: | |
| JRELEASER_CHOCOLATEY_USER: ${{ secrets.CHOCO_USER }} #manually extracted in jreleaser.yml | |
| - name: "Dry-run choco distribution" | |
| if: "${{ matrix.platform.name == 'windows-x86_64' }}" | |
| uses: jreleaser/release-action@v2 | |
| with: | |
| setup-java: false | |
| arguments: "publish --dry-run" | |
| env: | |
| JRELEASER_PROJECT_VERSION: ${{ needs.gradleCheck.outputs.RELEASE_VERSION }} | |
| JRELEASER_GITHUB_TOKEN: abc # don't provide correct token, just a dry-run | |
| JRELEASER_PACKAGERS_CHOCOLATEY_ACTIVE: ALWAYS | |
| JRELEASER_DISTRIBUTIONS_SPOTLESS_CLI_CHOCOLATEY_ACTIVE: ALWAYS | |
| JRELEASER_DISTRIBUTIONS_SPOTLESS_CLI_CHOCOLATEY_REPOSITORY_ACTIVE: ALWAYS | |
| JRELEASER_CHOCOLATEY_GITHUB_TOKEN: abc # don't provide correct token, just a dry-run | |
| JRELEASER_CHOCOLATEY_USER: abc # don't provide correct token, just a dry-run | |
| JRELEASER_CHOCOLATEY_API_KEY: abc # don't provide correct token, just a dry-run | |
| - name: "Dry-run brew distribution" | |
| if: "${{ matrix.platform.name == 'linux-x86_64' }}" | |
| uses: jreleaser/release-action@v2 | |
| with: | |
| setup-java: false | |
| arguments: "publish --dry-run" | |
| env: | |
| JRELEASER_PROJECT_VERSION: ${{ needs.gradleCheck.outputs.RELEASE_VERSION }} | |
| JRELEASER_GITHUB_TOKEN: abc # don't provide correct token, just a dry-run | |
| JRELEASER_DISTRIBUTIONS_SPOTLESS_CLI_BREW_ACTIVE: ALWAYS | |
| JRELEASER_HOMEBREW_GITHUB_TOKEN: abc # don't provide correct token, just a dry-run | |
| - name: "Persist jreleaser output" | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "jreleaser-distribution-dry-run--${{ matrix.platform.name }}" | |
| path: | | |
| out/jreleaser/trace.log | |
| out/jreleaser/output.properties | |
| out/jreleaser/package/spotless-cli/** |