|
18 | 18 | jobs: |
19 | 19 | build: |
20 | 20 | runs-on: ubuntu-latest |
| 21 | + outputs: |
| 22 | + is_release_version: ${{ steps.check-version.outputs.is_release_version }} |
| 23 | + version: ${{ steps.check-version.outputs.version }} |
21 | 24 | permissions: |
22 | 25 | contents: read |
23 | 26 | steps: |
24 | 27 | - name: Checkout code |
25 | 28 | uses: actions/checkout@v4 |
26 | 29 | with: |
27 | 30 | fetch-depth: 0 |
| 31 | + |
| 32 | + - name: Extract version and check if it's a release version |
| 33 | + id: check-version |
| 34 | + run: | |
| 35 | + # Extract version from build.gradle.kts |
| 36 | + VERSION=$(grep -E "val projectVersion = " build.gradle.kts | sed -E 's/.*"(.*)".*/\1/') |
| 37 | + echo "Extracted version: $VERSION" |
| 38 | + |
| 39 | + # Check if it's a release version (no suffix like -SNAPSHOT, -rc, etc.) |
| 40 | + if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then |
| 41 | + echo "This is a release version" |
| 42 | + echo "is_release_version=true" >> $GITHUB_OUTPUT |
| 43 | + else |
| 44 | + echo "This is not a release version" |
| 45 | + echo "is_release_version=false" >> $GITHUB_OUTPUT |
| 46 | + fi |
| 47 | + |
| 48 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
28 | 49 |
|
29 | 50 | # Setup JDK 17 for build |
30 | 51 | - name: 'Set up JDK 17' |
@@ -169,14 +190,33 @@ jobs: |
169 | 190 | uses: JetBrains/writerside-checker-action@v1 |
170 | 191 | with: |
171 | 192 | instance: ${{ env.INSTANCE }} |
| 193 | + |
| 194 | + log-docs-deployment-status: |
| 195 | + needs: [build, test-docs] |
| 196 | + runs-on: ubuntu-latest |
| 197 | + if: ${{ needs.build.outputs.is_release_version != 'true' }} |
| 198 | + steps: |
| 199 | + - name: Log version information |
| 200 | + run: | |
| 201 | + echo "Project version: ${{ needs.build.outputs.version }}" |
| 202 | + echo "Is release version: ${{ needs.build.outputs.is_release_version }}" |
| 203 | + echo "Skipping documentation deployment because this is not a final release version." |
| 204 | + echo "Documentation will only be deployed for versions in the format a.b.c without any suffix." |
172 | 205 |
|
173 | 206 | deploy-docs: |
174 | 207 | environment: |
175 | 208 | name: github-pages |
176 | 209 | url: ${{ steps.deployment.outputs.page_url }} |
177 | | - needs: [build-docs, test-docs] |
| 210 | + needs: [build, build-docs, test-docs] |
| 211 | + if: ${{ needs.build.outputs.is_release_version == 'true' }} |
178 | 212 | runs-on: ubuntu-latest |
179 | 213 | steps: |
| 214 | + - name: Log version information |
| 215 | + run: | |
| 216 | + echo "Project version: ${{ needs.build.outputs.version }}" |
| 217 | + echo "Is release version: ${{ needs.build.outputs.is_release_version }}" |
| 218 | + echo "Deploying documentation to GitHub Pages because this is a final release version." |
| 219 | + |
180 | 220 | - name: Download artifacts |
181 | 221 | uses: actions/download-artifact@v4 |
182 | 222 | with: |
|
0 commit comments