|
19 | 19 | gradleCheck:
|
20 | 20 | name: "run checks using gradlew"
|
21 | 21 | runs-on: "ubuntu-latest"
|
| 22 | + outputs: |
| 23 | + RELEASE_VERSION: ${{ steps.get_version.outputs.VERSION }} |
22 | 24 | env:
|
23 | 25 | SEGMENT_DOWNLOAD_TIMEOUT_MINS: "15"
|
24 | 26 | steps:
|
|
48 | 50 | run: "./gradlew :build-logic:check --no-configuration-cache"
|
49 | 51 | - name: "Run check on project"
|
50 | 52 | run: "./gradlew generateUsage && ./gradlew check"
|
| 53 | + - name: "Get version and set to output" |
| 54 | + id: get_version |
| 55 | + run: echo "VERSION=$(./gradlew changelogPrintCurrentVersion --quiet)" >> "$GITHUB_OUTPUT" |
51 | 56 | - name: "junit result"
|
52 | 57 | uses: "mikepenz/action-junit-report@v5"
|
53 | 58 | if: "always()"
|
@@ -107,5 +112,66 @@ jobs:
|
107 | 112 | path: app/build/native/nativeCompile/spotless*
|
108 | 113 | retention-days: 7
|
109 | 114 | if-no-files-found: "error"
|
110 |
| -# TODO add job to check if jrelease distribute would be working |
111 |
| -# eg using `JRELEASER_GITHUB_TOKEN=123 jreleaser -Djreleaser.project.version=0.1.0 publish --dry-run` |
| 115 | + |
| 116 | + dryRunRelease: |
| 117 | + name: "dry run release" |
| 118 | + needs: ["gradleCheck", "nativeCompile"] |
| 119 | + strategy: |
| 120 | + matrix: |
| 121 | + platform: |
| 122 | + - name: "linux-x86_64" |
| 123 | + runner: "ubuntu-latest" |
| 124 | + - name: "windows-x86_64" |
| 125 | + runner: "windows-latest" |
| 126 | + runs-on: "${{ matrix.platform.runner }}" |
| 127 | + steps: |
| 128 | + - name: "Checkout" |
| 129 | + uses: "actions/checkout@v4" |
| 130 | + with: |
| 131 | + fetch-depth: 0 |
| 132 | + - name: "Install JDK 21" |
| 133 | + uses: "actions/setup-java@v4" |
| 134 | + with: |
| 135 | + distribution: "graalvm" |
| 136 | + java-version: 21 |
| 137 | + - name: "Setup Gradle" |
| 138 | + uses: "gradle/actions/setup-gradle@v4" |
| 139 | + - name: "Retrieve binaries" |
| 140 | + uses: "actions/download-artifact@v4" |
| 141 | + with: |
| 142 | + # no name - download all artifacts |
| 143 | + path: "app/build/collected-binaries" |
| 144 | + - name: "Prepare release zips for distribution" |
| 145 | + run: "./gradlew -PreleaseBinariesRootDir=app/build/collected-binaries prepareReleaseBinaryZips" |
| 146 | + - name: "Dry-run choco distribution" |
| 147 | + if: "${{ matrix.platform.name == 'windows-x86_64' }}" |
| 148 | + uses: jreleaser/release-action@v2 |
| 149 | + with: |
| 150 | + setup-java: false |
| 151 | + arguments: "publish --dry-run" |
| 152 | + env: |
| 153 | + JRELEASER_PROJECT_VERSION: ${{ jobs.gradleCheck.outputs.RELEASE_VERSION }} |
| 154 | + JRELEASER_GITHUB_TOKEN: abc # don't provide correct token, just a dry-run |
| 155 | + JRELEASER_DISTRIBUTIONS_SPOTLESS_CLI_CHOCOLATEY_ACTIVE: ALWAYS |
| 156 | + JRELEASER_CHOCOLATEY_GITHUB_TOKEN: abc # don't provide correct token, just a dry-run |
| 157 | + JRELEASER_CHOCOLATEY_API_KEY: abc # don't provide correct token, just a dry-run |
| 158 | + - name: "Dry-run brew distribution" |
| 159 | + if: "${{ matrix.platform.name == 'linux-x86_64' }}" |
| 160 | + uses: jreleaser/release-action@v2 |
| 161 | + with: |
| 162 | + setup-java: false |
| 163 | + arguments: "publish --dry-run" |
| 164 | + env: |
| 165 | + JRELEASER_PROJECT_VERSION: ${{ jobs.gradleCheck.outputs.RELEASE_VERSION }} |
| 166 | + JRELEASER_GITHUB_TOKEN: abc # don't provide correct token, just a dry-run |
| 167 | + JRELEASER_DISTRIBUTIONS_SPOTLESS_CLI_BREW_ACTIVE: ALWAYS |
| 168 | + JRELEASER_HOMEBREW_GITHUB_TOKEN: abc # don't provide correct token, just a dry-run |
| 169 | + - name: "Persist jreleaser output" |
| 170 | + if: always() |
| 171 | + uses: actions/upload-artifact@v4 |
| 172 | + with: |
| 173 | + name: "jreleaser-distribution-dry-run--${{ matrix.platform.name }}" |
| 174 | + path: | |
| 175 | + out/jreleaser/trace.log |
| 176 | + out/jreleaser/output.properties |
| 177 | + out/jreleaser/package/spotless-cli/** |
0 commit comments