Skip to content

Commit ae3f547

Browse files
committed
Add a reusable spring-trigger-dependabot-updates.yml workflow
* Replace `[artifactory-release]` prefix in a commit message to the `[CI/CD]` for better generic context * Fix `artifactoryPublish` Gradle task to the `publishAllPublicationsToDeploymentRepository` in the `spring-artifactory-gradle-release.yml` `buildToolArgs` input description * Fix typos in the `README.md` * Mention `spring-trigger-dependabot-updates.yml` in the `README.md`
1 parent b9dd30c commit ae3f547

4 files changed

Lines changed: 60 additions & 22 deletions

File tree

.github/workflows/spring-artifactory-gradle-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
buildToolArgs:
7-
description: 'Additional Gradle command arguments: tasks, options etc. The `build` and `artifactoryPublish` for Gradle are included.'
7+
description: 'Additional Gradle command arguments: tasks, options etc. The `build` and `publishAllPublicationsToDeploymentRepository` for Gradle are included.'
88
required: false
99
type: string
1010
artifactoryUrl:

.github/workflows/spring-finalize-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
git fetch origin --no-tags
4949
git pull origin ${{ github.ref }}
5050
51-
git commit -a -m "[artifactory-release] Release version ${{ inputs.milestone }}"
51+
git commit -a -m "[CI/CD] Release version ${{ inputs.milestone }}"
5252
git tag "v${{ inputs.milestone }}"
5353
5454
NEXT_VERSION="${{ inputs.milestone }}"
@@ -72,7 +72,7 @@ jobs:
7272
sed -i "s/version=.*/version=$NEXT_VERSION/" gradle.properties
7373
fi
7474
75-
git commit -a -m "[artifactory-release] Next development version"
75+
git commit -a -m "[CI/CD] Next development version"
7676
git push origin
7777
git push --tags origin
7878
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Trigger Dependabot Updates
2+
3+
# This workflow is a convenient alternative to the GitHub UI interface for Dependabot updates.
4+
# The workflow performs Toggle executable permission as a superficial change on the dependabot.yml file.
5+
# That is enough for Dependabot to understand that some changes have happened in the dependency updates config.
6+
7+
on:
8+
workflow_call:
9+
secrets:
10+
GH_ACTIONS_REPO_TOKEN:
11+
required: true
12+
13+
jobs:
14+
trigget-dependabot:
15+
runs-on: ubuntu-latest
16+
steps:
17+
18+
- uses: actions/checkout@v6
19+
with:
20+
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
21+
show-progress: false
22+
23+
- name: Touch dependabot.yml
24+
run: |
25+
file=".github/dependabot.yml"
26+
# Toggle executable permission as a superficial change
27+
[ -x "$file" ] && chmod -x "$file" || chmod +x "$file"
28+
29+
git config --global user.name 'Spring Builds'
30+
git config --global user.email 'builds@springframework.org'
31+
git commit -am "CI/CD: Trigger dependabot updates"
32+
git push origin

README.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ The `SPRING_RELEASE_CHAT_WEBHOOK_URL` secret is also optional: probably you don'
2727
As well as `OSSRH_*` secret, since not all releases might go to Maven Central, e.g. private (commercial) repositories only.
2828
Also, the `OSSRH_*` and `CENTRAL_TOKEN_*` secrets are mutually exclusive where `CENTRAL_TOKEN_*` will lead to publishing via [Maven Central Portal](https://central.sonatype.org/register/central-portal/).
2929

30-
The mentioned secrets must be passed explicitly since these reusable workflows might be in different GitHub org than target project.
30+
The mentioned secrets must be passed explicitly since these reusable workflows might be in a different GitHub org than the target project.
3131

32-
The SNAPSHOT and Release workflows uses [spring-io/artifactory-deploy-action](https://github.com/spring-io/artifactory-deploy-action) to publish artifacts into Artifactory.
32+
The SNAPSHOT and Release workflows use [spring-io/artifactory-deploy-action](https://github.com/spring-io/artifactory-deploy-action) to publish artifacts into Artifactory.
3333

3434
## Build SNAPSHOT and Pull Request Workflows
3535

@@ -43,7 +43,7 @@ https://github.com/spring-io/spring-github-workflows/blob/29fd75ff06da2789a1fcd9
4343
#### Maven Pull Request caller workflow:
4444
https://github.com/spring-io/spring-github-workflows/blob/29fd75ff06da2789a1fcd9b1732bf8bce4704fa6/samples/pr-build-maven.yml#L1-L10
4545

46-
You can add more branches to react for pull request events.
46+
You can add more branches to react to pull request events.
4747

4848
The SNAPSHOT workflows ([spring-artifactory-gradle-snapshot.yml](.github/workflows/spring-artifactory-gradle-snapshot.yml) and [spring-artifactory-maven-snapshot.yml](.github/workflows/spring-artifactory-maven-snapshot.yml), respectively) are also that simple.
4949
They publish artifacts into `libs-snapshot-local` (by default) repository.
@@ -64,10 +64,10 @@ The [spring-artifactory-gradle-release.yml](.github/workflows/spring-artifactory
6464

6565
- The versioning schema must follow these rules: 3-digit-dotted number for `major`, `minor` and `patch` parts, snapshot is suffixed with `-SNAPSHOT`, milestones are with `-M{number}` and `-RC{number}` suffix, the GA release is without any suffix.
6666
For example: `0.0.1-SNAPSHOT`, `1.0.0-M1`, `2.1.0-RC2`, `3.3.3`.
67-
- GitHub Milestone titles must be exact as the version to release number.
67+
- GitHub Milestone titles must be exact as the version-to-release number.
6868
For example: `1.0.0-M1`, `2.1.0-RC2`, `3.3.3`.
6969
- GitHub Milestones must be scheduled: have a `Due on` date set.
70-
Otherwise, release workflow will be cancelled with a warning that nothing to release for respective SNAPSHOT in a branch.
70+
Otherwise, the release workflow will be cancelled with a warning that nothing to release for the respective SNAPSHOT in a branch.
7171

7272
The logic of this release workflow:
7373

@@ -80,25 +80,25 @@ This job stages released artifacts using JFrog Artifactory plugin into `libs-sta
8080
- The next job is to [verify staged artifacts](#verify-staged-artifacts)
8181
- When verification is successful, next job promotes release from staging either to `libs-milestone-local` or `libs-release-local` (by default) (and optional to Maven Central: if `bundleName` input is not provided) according to the releasing version schema
8282
- Then [spring-finalize-release.yml](.github/workflows/spring-finalize-release.yml) job is executed, which tags release into GitHub, commits next development version, generates release notes using [Spring Changelog Generator](https://github.com/spring-io/github-changelog-generator) excluding repository admins from `Contributors` section.
83-
The `gh release create` command is performed on a tag for just released version.
84-
Then spring.io project page is updated for newly released version.
83+
The `gh release create` command is performed on a tag for a just released version.
84+
Then `spring.io` project page is updated for a newly released version.
8585
(The [spring-website-project-version-update](.github/actions/spring-website-project-version-update) local action is implemented for this goal).
86-
And in the end the milestone closed and specific Google Space notified about release (if `SPRING_RELEASE_CHAT_WEBHOOK_URL` secret is present in the repository).
86+
And in the end the milestone closed, and specific Google Space notified about release (if `SPRING_RELEASE_CHAT_WEBHOOK_URL` secret is present in the repository).
8787

8888
#### Example of Release caller workflow:
8989
https://github.com/spring-io/spring-github-workflows/blob/88d5c5f78e88d00b9ad18885438d4e3657433ccf/samples/release-with-gradle.yml#L1-L24
9090

91-
Such a workflow must be on every branch which is supposed to be released via GitHub actions.
91+
Such a workflow must be on every branch that is supposed to be released via GitHub actions.
9292

9393
The `buildToolArgs` parameter for this job means extra build tool arguments.
9494
For example, the mentioned `dist` value is a Gradle task in the project.
9595
Can be any Maven goal or other command line arguments.
9696

9797
The signing released artifacts is done by the [spring-io/artifactory-deploy-action](https://github.com/spring-io/artifactory-deploy-action) if `GPG_PASSPHRASE` and `GPG_PRIVATE_KEY` secrets are provided.
98-
In the end all the artifacts, together with their signatures, are uploaded to the Artifactory according to the respective workflow inputs.
98+
In the end, all the artifacts, together with their signatures, are uploaded to the Artifactory according to the respective workflow inputs.
9999

100-
In the end you just need to go to the `Actions` tab on your project, press `Run workflow` on your release workflow and choose a branch from drop-down list to release currently scheduled Milestone against.
101-
Such a release workflow can also be scheduled (`cron`, fo example) against branches matrix.
100+
In the end you just need to go to the `Actions` tab on your project, press `Run workflow` on your release workflow and choose a branch from a drop-down list to release currently scheduled Milestone against.
101+
Such a release workflow can also be scheduled (`cron`, for example) against branches matrix.
102102

103103
#### Scheduler workflow example:
104104
https://github.com/spring-io/spring-github-workflows/blob/78b29123a17655f019d800690cc906d692f836a9/samples/schedule-releases.yml#L1-L19
@@ -112,9 +112,9 @@ https://github.com/spring-io/spring-github-workflows/blob/78b29123a17655f019d800
112112

113113
The `verify-staged` job expects an optional `verifyStagedWorkflow` input (the `verify-staged-artifacts.yml`, by default) workflow supplied from the target project.
114114
For example, [Spring Integration for AWS](https://github.com/spring-projects/spring-integration-aws) uses `jfrog rt download` command to verify that released `spring-integration-aws-${{ inputs.releaseVersion }}.jar` is valid.
115-
Other projects may check out their samples repository and setup release version to perform smoke tests against just staged artifacts.
115+
Other projects may check out their samples repository and set up release version to perform smoke tests against just staged artifacts.
116116

117-
#### Verify staged workflow sample:
117+
#### Verify the staged workflow sample:
118118
https://github.com/spring-io/spring-github-workflows/blob/78b29123a17655f019d800690cc906d692f836a9/samples/verify-staged-artifacts.yml#L1-L28
119119

120120
## Backport GitHub Issue Workflow
@@ -127,19 +127,19 @@ https://github.com/spring-io/spring-github-workflows/blob/521ac488abc90d96170403
127127

128128
## Dependabot Support
129129

130-
If [Dependabot](https://github.com/dependabot) is enabled for repository, its config should set a label compatible with [Spring Changelog Generator](https://github.com/spring-io/github-changelog-generator).
130+
If [Dependabot](https://github.com/dependabot) is enabled for the repository, its config should set a label compatible with [Spring Changelog Generator](https://github.com/spring-io/github-changelog-generator).
131131
Typically, it is `type: dependency-upgrade`.
132132
It is also a good practice to group all the development dependencies into a single pull request from Dependabot.
133133
This includes all the Gradle and Maven plugins and those dependencies which are used only for testing in the project.
134-
This projects provides a [spring-merge-dependabot-pr.yml](.github/workflows/spring-merge-dependabot-pr.yml) reusable workflow to make modifications to the Dependabot pull requests.
134+
This project provides a [spring-merge-dependabot-pr.yml](.github/workflows/spring-merge-dependabot-pr.yml) reusable workflow to make modifications to the Dependabot pull requests.
135135
However, there are some prerequisites to use this workflow in your project:
136-
- Pull requests must be protected by some check to pass, usually a workflow to build the project with this pull request changes;
136+
- Pull requests must be protected by some check to pass, usually a workflow to build the project with these pull request changes;
137137
- The [auto-merge](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository) must be enabled in the repository (if `--auto` is used);
138138

139139
The `spring-merge-dependabot-pr` workflow does these modifications to the Dependabot pull requests:
140140
- Modify label from `dependency-upgrade` to the `task` for the development dependencies group update to skip them from release notes by Spring Changelog Generator;
141141
- Adds a currently scheduled milestone to the pull request against a snapshot version extracted from the target branch;
142-
- And if milestone is scheduled, the pull request is queued for auto-merging after required checks have passed;
142+
- And if a milestone is scheduled, the pull request is queued for auto-merging after required checks have passed;
143143
- If `autoMergeSnapshots` input is set to `true`, the upgrade from Milestone/Release Candidate dependency to its SNAPSHOT is going to be merged automatically without assigning a milestone to the PR.
144144

145145
The `mergeArguments` input of this workflow is applied to the `gh pr merge` command.
@@ -149,7 +149,7 @@ https://github.com/spring-io/spring-github-workflows/blob/521ac488abc90d96170403
149149

150150
## Automatic cherry-pick workflow
151151

152-
The [spring-cherry-pick.yml](.github/workflows/spring-cherry-pick.yml) workflow offers a logic to cherry-pick pushed commit to branches suggested by the specific sentence in commit message.
152+
The [spring-cherry-pick.yml](.github/workflows/spring-cherry-pick.yml) workflow offers a logic to cherry-pick pushed commit to branches suggested by the specific sentence in the commit message.
153153
For example `Auto-cherry-pick to 6.2.x & 6.1.x`.
154154
The `Auto-cherry-pick` token is a default value for the `autoCherryPickToken` input of this workflow.
155155
The branches to cherry-pick to are extracted from the matching sentence.
@@ -175,6 +175,12 @@ jobs:
175175
```
176176
The workflow reacts to non-empty `due_on` property of the event's milestone payload and check if this property really was changed on milestone edit.
177177

178+
## Trigger Dependabot Updates
179+
180+
The [spring-trigger-dependabot-updates.yml](.github/workflows/spring-trigger-dependabot-updates.yml) workflow is a convenient alternative to the GitHub UI interface for Dependabot updates ($GH_REPOSITORY/network/updates).
181+
The workflow performs toggle executable permission as a superficial change on the `dependabot.yml` file.
182+
That is enough for Dependabot to understand that some changes have happened in the dependency updates config to trigger new versions check.
183+
178184
## "Dispatch Workflow and Wait" Action
179185

180186
The [spring-dispatch-workflow-and-wait](.github/actions/spring-dispatch-workflow-and-wait/action.yml) action implements the logic to call `gh workflow run` for the provided workflow file and wait until it is complete, successful or not.

0 commit comments

Comments
 (0)