Skip to content

Commit 304cee6

Browse files
authored
Automate releases with JEP-229 (#232)
* Use parent pom 4.54 * Switch delivery to JEP-229 style GitHub has deprecated some of the items in the action that releases this plugin. Rather than resolve that deprecation, let's switch to the way that 200+ other Jenkins plugins perform releases. Always have the option to refer to the git history for previous release techniques.
1 parent 17ec633 commit 304cee6

File tree

5 files changed

+15
-103
lines changed

5 files changed

+15
-103
lines changed

.github/release-drafter.yml

-1
This file was deleted.

.github/workflows/cd.yaml

+10-73
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,15 @@
1-
---
1+
# Note: additional setup is required, see https://www.jenkins.io/redirect/continuous-delivery-of-plugins
2+
23
name: cd
34
on:
45
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
8-
- master
6+
check_run:
7+
types:
8+
- completed
99

1010
jobs:
11-
deploy:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- name: Check out
15-
uses: actions/checkout@v3
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Set up JDK 8
20-
uses: actions/setup-java@v3
21-
with:
22-
distribution: 'temurin'
23-
java-version: 8
24-
25-
- name: Wait for build to succeed
26-
uses: fountainhead/[email protected]
27-
id: wait-for-build
28-
with:
29-
token: ${{ secrets.GITHUB_TOKEN }}
30-
checkName: Jenkins
31-
32-
- name: next release version
33-
id: nextversion
34-
uses: jenkins-x-plugins/[email protected]
35-
36-
- name: Set Version
37-
run: |
38-
mvn --no-transfer-progress versions:set -DnewVersion=${{ steps.nextversion.outputs.version }}
39-
- name: Release Drafter
40-
uses: release-drafter/[email protected]
41-
if: steps.wait-for-build.outputs.conclusion == 'success'
42-
with:
43-
name: next
44-
tag: next
45-
version: next
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
49-
- name: Interesting
50-
id: interesting
51-
if: steps.wait-for-build.outputs.conclusion == 'success'
52-
run: |
53-
set -euxo pipefail
54-
echo $GITHUB_EVENT_NAME
55-
if [ "${GITHUB_EVENT_NAME}" = "push" ]
56-
then
57-
INTERESTING_CATEGORIES='[💥🚨🎉🐛⚠🚀👷]|:(boom|tada|construction_worker):'
58-
CATEGORIES=$(gh api /repos/$GITHUB_REPOSITORY/releases | jq -e -r '.[] | select(.draft == true and .name == "next") | .body')
59-
if echo "${CATEGORIES}" | egrep -q "${INTERESTING_CATEGORIES}"; then
60-
echo "Interesting release"
61-
echo "should_release=true" >> $GITHUB_OUTPUT
62-
else
63-
echo "Not interesting release"
64-
echo "should_release=false" >> $GITHUB_OUTPUT
65-
fi
66-
else
67-
echo "should_release=true" >> $GITHUB_OUTPUT
68-
fi
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
72-
- name: Release
73-
uses: jenkins-infra/jenkins-maven-cd-action@master
74-
if: steps.interesting.outputs.should_release == 'true'
75-
with:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
78-
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
11+
maven-cd:
12+
uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1
13+
secrets:
14+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
15+
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}

.github/workflows/report-version.yaml

-24
This file was deleted.

.mvn/maven.config

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
-Pconsume-incrementals
22
-Pmight-produce-incrementals
3+
-Dchangelist.format=%d.v%s

pom.xml

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<parent>
66
<groupId>org.jenkins-ci.plugins</groupId>
77
<artifactId>plugin</artifactId>
8-
<version>4.53</version>
8+
<version>4.54</version>
99
<relativePath />
1010
</parent>
1111

1212
<artifactId>elastic-axis</artifactId>
13-
<version>${revision}${changelist}</version>
13+
<version>${changelist}</version>
1414
<packaging>hpi</packaging>
1515

1616
<name>Elastic Axis Plugin</name>
@@ -31,14 +31,13 @@
3131

3232
<scm>
3333
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
34-
<developerConnection>scm:git:ssh://[email protected]/${gitHubRepo}.git</developerConnection>
34+
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
3535
<tag>${scmTag}</tag>
3636
<url>https://github.com/${gitHubRepo}</url>
3737
</scm>
3838

3939
<properties>
40-
<revision>1.7</revision>
41-
<changelist>-SNAPSHOT</changelist>
40+
<changelist>999999-SNAPSHOT</changelist>
4241
<gitHubRepo>jenkinsci/elastic-axis-plugin</gitHubRepo>
4342
<jenkins.version>2.361.4</jenkins.version>
4443
<spotbugs.effort>Max</spotbugs.effort>

0 commit comments

Comments
 (0)