Skip to content

Commit 8d93f67

Browse files
committed
Harmonize CI structure
1 parent b17dde2 commit 8d93f67

File tree

6 files changed

+59
-53
lines changed

6 files changed

+59
-53
lines changed

.github/actions/build/action.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
name: 'Build'
22
description: 'Builds the project, optionally publishing it to a local deployment repository'
33
inputs:
4-
java-version:
4+
develocity-access-key:
5+
description: 'Access key for authentication with ge.spring.io'
56
required: false
6-
default: '17'
7-
description: 'The Java version to compile and test with'
87
java-distribution:
8+
description: 'Java distribution to use'
99
required: false
1010
default: 'liberica'
11-
description: 'The Java distribution to use for the build'
1211
java-toolchain:
13-
required: false
14-
default: 'false'
1512
description: 'Whether a Java toolchain should be used'
16-
publish:
1713
required: false
1814
default: 'false'
15+
java-version:
16+
description: 'Java version to compile and test with'
17+
required: false
18+
default: '17'
19+
publish:
1920
description: 'Whether to publish artifacts ready for deployment to Artifactory'
20-
develocity-access-key:
2121
required: false
22-
description: 'The access key for authentication with ge.spring.io'
22+
default: 'false'
2323
outputs:
2424
build-scan-url:
25-
description: 'The URL, if any, of the build scan produced by the build'
25+
description: 'URL, if any, of the build scan produced by the build'
2626
value: ${{ (inputs.publish == 'true' && steps.publish.outputs.build-scan-url) || steps.build.outputs.build-scan-url }}
2727
version:
28-
description: 'The version that was built'
28+
description: 'Version that was built'
2929
value: ${{ steps.read-version.outputs.version }}
3030
runs:
3131
using: composite
@@ -34,9 +34,9 @@ runs:
3434
uses: ./.github/actions/prepare-gradle-build
3535
with:
3636
develocity-access-key: ${{ inputs.develocity-access-key }}
37-
java-version: ${{ inputs.java-version }}
3837
java-distribution: ${{ inputs.java-distribution }}
3938
java-toolchain: ${{ inputs.java-toolchain }}
39+
java-version: ${{ inputs.java-version }}
4040
- name: Build
4141
id: build
4242
if: ${{ inputs.publish == 'false' }}

.github/actions/create-github-release/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ name: Create GitHub Release
22
description: Create the release on GitHub with a changelog
33
inputs:
44
milestone:
5-
description: Name of the GitHub milestone for which a release will be created
6-
required: true
7-
token:
8-
description: Token to use for authentication with GitHub
5+
description: 'Name of the GitHub milestone for which a release will be created'
96
required: true
107
pre-release:
11-
description: Whether the release is a pre-release (a milestone or release candidate)
8+
description: 'Whether the release is a pre-release (a milestone or release candidate)'
129
required: false
1310
default: 'false'
11+
token:
12+
description: 'Token to use for authentication with GitHub'
13+
required: true
1414
runs:
1515
using: composite
1616
steps:
1717
- name: Generate Changelog
1818
uses: spring-io/github-changelog-generator@86958813a62af8fb223b3fd3b5152035504bcb83 #v0.0.12
1919
with:
20+
config-file: .github/actions/create-github-release/changelog-generator.yml
2021
milestone: ${{ inputs.milestone }}
2122
token: ${{ inputs.token }}
22-
config-file: .github/actions/create-github-release/changelog-generator.yml
2323
- name: Create GitHub Release
24+
shell: bash
2425
env:
2526
GITHUB_TOKEN: ${{ inputs.token }}
26-
shell: bash
2727
run: gh release create ${{ format('v{0}', inputs.milestone) }} --notes-file changelog.md ${{ inputs.pre-release == 'true' && '--prerelease' || '' }}

.github/actions/prepare-gradle-build/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
name: 'Prepare Gradle Build'
22
description: 'Prepares a Gradle build. Sets up Java and Gradle and configures Gradle properties'
33
inputs:
4-
java-version:
4+
develocity-access-key:
5+
description: 'Access key for authentication with ge.spring.io'
56
required: false
6-
default: '17'
7-
description: 'The Java version to use for the build'
87
java-distribution:
8+
description: 'Java distribution to use'
99
required: false
1010
default: 'liberica'
11-
description: 'The Java distribution to use for the build'
1211
java-toolchain:
12+
description: 'Whether a Java toolchain should be used'
1313
required: false
1414
default: 'false'
15-
description: 'Whether a Java toolchain should be used'
16-
develocity-access-key:
15+
java-version:
16+
description: 'Java version to use for the build'
1717
required: false
18-
description: 'The access key for authentication with ge.spring.io'
18+
default: '17'
1919
runs:
2020
using: composite
2121
steps:
Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
11
name: Send Notification
2-
description: Sends a Google Chat message as a notification of the job's outcome
2+
description: 'Sends a Google Chat message as a notification of the job''s outcome'
33
inputs:
4-
webhook-url:
5-
description: 'Google Chat Webhook URL'
6-
required: true
7-
status:
8-
description: 'Status of the job'
9-
required: true
104
build-scan-url:
115
description: 'URL of the build scan to include in the notification'
6+
required: false
127
run-name:
138
description: 'Name of the run to include in the notification'
9+
required: false
1410
default: ${{ format('{0} {1}', github.ref_name, github.job) }}
11+
status:
12+
description: 'Status of the job'
13+
required: true
14+
webhook-url:
15+
description: 'Google Chat Webhook URL'
16+
required: true
1517
runs:
1618
using: composite
1719
steps:
18-
- shell: bash
20+
- name: Prepare Variables
21+
shell: bash
1922
run: |
2023
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
2124
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV"
22-
- shell: bash
25+
- name: Success Notification
2326
if: ${{ inputs.status == 'success' }}
27+
shell: bash
2428
run: |
2529
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true
26-
- shell: bash
30+
- name: Failure Notification
2731
if: ${{ inputs.status == 'failure' }}
32+
shell: bash
2833
run: |
2934
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true
30-
- shell: bash
35+
- name: Cancel Notification
3136
if: ${{ inputs.status == 'cancelled' }}
37+
shell: bash
3238
run: |
3339
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true

.github/workflows/build-and-deploy-snapshot.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ concurrency:
1010
jobs:
1111
build-and-deploy-snapshot:
1212
name: Build and Deploy Snapshot
13-
runs-on: ubuntu-latest
1413
if: ${{ github.repository == 'spring-gradle-plugins/nullability-plugin' }}
14+
runs-on: ubuntu-latest
1515
steps:
1616
- name: Check Out Code
1717
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -22,23 +22,23 @@ jobs:
2222
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
2323
publish: true
2424
- name: Deploy
25-
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
25+
uses: spring-io/artifactory-deploy-action@dc1913008c0599f0c4b1fdafb6ff3c502b3565ea # v0.0.2
2626
with:
27-
uri: 'https://repo.spring.io'
28-
username: ${{ secrets.ARTIFACTORY_USERNAME }}
29-
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
3027
build-name: 'nullability-plugin-0.0.x'
31-
repository: 'libs-snapshot-local'
3228
folder: 'deployment-repository'
29+
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
30+
repository: 'libs-snapshot-local'
3331
signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
3432
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
33+
uri: 'https://repo.spring.io'
34+
username: ${{ secrets.ARTIFACTORY_USERNAME }}
3535
- name: Send Notification
36-
uses: ./.github/actions/send-notification
3736
if: always()
37+
uses: ./.github/actions/send-notification
3838
with:
39-
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
40-
status: ${{ job.status }}
4139
build-scan-url: ${{ steps.build-and-publish.outputs.build-scan-url }}
4240
run-name: ${{ format('{0} | Linux | Java 17', github.ref_name) }}
41+
status: ${{ job.status }}
42+
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
4343
outputs:
4444
version: ${{ steps.build-and-publish.outputs.version }}

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ name: CI
22
on:
33
push:
44
branches:
5-
- main
5+
- 'main'
66
permissions:
77
contents: read
88
concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
jobs:
1111
ci:
1212
name: '${{ matrix.os.name}} | Java ${{ matrix.java.version}}'
13-
runs-on: ${{ matrix.os.id }}
1413
if: ${{ github.repository == 'spring-gradle-plugins/nullability-plugin' }}
14+
runs-on: ${{ matrix.os.id }}
1515
strategy:
1616
matrix:
1717
os:
@@ -44,15 +44,15 @@ jobs:
4444
id: build
4545
uses: ./.github/actions/build
4646
with:
47-
java-version: ${{ matrix.java.version }}
47+
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
4848
java-distribution: ${{ matrix.java.distribution || 'liberica' }}
4949
java-toolchain: ${{ matrix.java.toolchain }}
50-
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
50+
java-version: ${{ matrix.java.version }}
5151
- name: Send Notification
52-
uses: ./.github/actions/send-notification
5352
if: always()
53+
uses: ./.github/actions/send-notification
5454
with:
55-
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
56-
status: ${{ job.status }}
5755
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
5856
run-name: ${{ format('{0} | {1} | Java {2}', github.ref_name, matrix.os.name, matrix.java.version) }}
57+
status: ${{ job.status }}
58+
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}

0 commit comments

Comments
 (0)