Skip to content

Commit 6d5e5a6

Browse files
authored
ci: release note generation job (#5687)
* ci: release note generation job * workflow_dispatch for easy testing
1 parent 2dd5997 commit 6d5e5a6

File tree

8 files changed

+702
-1
lines changed

8 files changed

+702
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
pull_request:
3+
paths:
4+
- 'release-note-generation/**'
5+
name: release-note-generation-test
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-java@v3
12+
with:
13+
distribution: zulu
14+
java-version: 11
15+
- run: java -version
16+
- name: Run test in release-note-generation
17+
shell: bash
18+
run: |
19+
mvn -B -ntp verify
20+
working-directory: release-note-generation
21+
22+
dry-run:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-java@v3
27+
with:
28+
distribution: zulu
29+
java-version: 11
30+
- run: java -version
31+
- name: Dry-run release-note-generation
32+
shell: bash
33+
run: |
34+
mvn -B -ntp compile
35+
# This generates release_note.md file
36+
mvn -B -ntp exec:java \
37+
-Dexec.args="com.google.cloud:libraries-bom:26.1.5"
38+
working-directory: release-note-generation
39+
- name: Show generated release note
40+
shell: bash
41+
run: |
42+
# This fails if the file does not exist
43+
cat release_note.md
44+
working-directory: release-note-generation
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
librariesBomVersion:
5+
description: 'The version of the Libraries BOM we generate release note (e.g., 26.1.5)'
6+
required: true
7+
type: string
8+
9+
release: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
10+
types: [published]
11+
12+
name: release-notes
13+
jobs:
14+
release-note-generation:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-java@v3
19+
with:
20+
distribution: zulu
21+
java-version: 11
22+
- run: java -version
23+
- name: Generate release_note.md
24+
shell: bash
25+
run: |
26+
mvn -B -ntp compile
27+
# This generates release_note.md file
28+
mvn -B -ntp exec:java \
29+
-Dexec.args="com.google.cloud:libraries-bom:${LIBRARIES_BOM_VERSION}"
30+
working-directory: release-note-generation
31+
env:
32+
LIBRARIES_BOM_VERSION: ${{ inputs.librariesBomVersion }}
33+
- name: Update the release note with release_note.md
34+
run: |
35+
TAG="libraries-bom-v${LIBRARIES_BOM_VERSION}"
36+
echo "Updating ${TAG}"
37+
gh release edit "${TAG}" --notes-file release_note.md
38+
working-directory: release-note-generation
39+
env:
40+
LIBRARIES_BOM_VERSION: ${{ inputs.librariesBomVersion }}
41+
GH_TOKEN: ${{ github.token }}
42+

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ docs/
2828

2929
# Python utilities
3030
*.pyc
31+
32+
# Release note generation
33+
release_note.md

dashboard/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<groupId>com.google.cloud.tools</groupId>
88
<artifactId>dependencies-parent</artifactId>
99
<version>1.5.13</version>
10+
<relativePath/>
1011
</parent>
1112
<artifactId>google-cloud-bom-dashboard</artifactId>
1213
<version>0.0.1-SNAPSHOT</version>

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</license>
2828
</licenses>
2929
<modules>
30-
<!-- Only modules to be published to Maven Central. Not tests. -->
30+
<!-- Only modules to be published to Maven Central. No tests or release note generation. -->
3131
<module>google-cloud-bom</module>
3232
<module>libraries-bom</module>
3333
</modules>

release-note-generation/pom.xml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
6+
<parent>
7+
<artifactId>java-cloud-bom-root</artifactId>
8+
<groupId>com.google.cloud</groupId>
9+
<version>0.1.0</version>
10+
</parent>
11+
<modelVersion>4.0.0</modelVersion>
12+
13+
<artifactId>release-note-generation</artifactId>
14+
15+
<name>Release Note Generation for Cloud SDK for Java</name>
16+
17+
<properties>
18+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
<maven.compiler.source>1.8</maven.compiler.source>
20+
<maven.compiler.target>1.8</maven.compiler.target>
21+
</properties>
22+
23+
<dependencies>
24+
<dependency>
25+
<groupId>com.google.cloud.tools</groupId>
26+
<artifactId>dependencies</artifactId>
27+
<version>1.5.13</version>
28+
</dependency>
29+
<dependency>
30+
<groupId>junit</groupId>
31+
<artifactId>junit</artifactId>
32+
<version>4.11</version>
33+
<scope>test</scope>
34+
</dependency>
35+
<dependency>
36+
<groupId>com.google.truth</groupId>
37+
<artifactId>truth</artifactId>
38+
<version>1.1.3</version>
39+
<scope>test</scope>
40+
</dependency>
41+
</dependencies>
42+
43+
<build>
44+
<plugins>
45+
<plugin>
46+
<groupId>org.codehaus.mojo</groupId>
47+
<artifactId>exec-maven-plugin</artifactId>
48+
<configuration>
49+
<skip>false</skip>
50+
<mainClass>com.google.cloud.ReleaseNoteGeneration</mainClass>
51+
</configuration>
52+
</plugin>
53+
</plugins>
54+
</build>
55+
</project>

0 commit comments

Comments
 (0)