Skip to content

Commit 6352cbd

Browse files
authored
Merge pull request #1939 from microsoftgraph/ci/add-release-please-bot
ci: add release please bot
2 parents aa648d1 + cef573d commit 6352cbd

File tree

11 files changed

+112
-106
lines changed

11 files changed

+112
-106
lines changed

.github/workflows/git-release.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ jobs:
2222
event: push
2323
name: drop
2424
path: drop
25-
- name: Github Release
26-
uses: anton-yurchenko/git-release@v6.0
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29-
DRAFT_RELEASE: "false"
30-
PRE_RELEASE: "false"
31-
CHANGELOG_FILE: "CHANGELOG.md"
32-
ALLOW_EMPTY_CHANGELOG: "true"
25+
# This action works with an existing release (created by the release bot) and uploads the build artifacts
26+
- name: GitHub Release
27+
uses: softprops/action-gh-release@v2
28+
if: startsWith(github.ref, 'refs/tags/')
3329
with:
34-
args: |
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
fail_on_unmatched_files: true
32+
files: |
3533
drop/build/**/*.jar

.github/workflows/preview-and-release.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,3 @@ jobs:
9494
gradle.properties
9595
**/gradle/**
9696
Scripts/**
97-
98-
create_Tag:
99-
needs: maven_Release
100-
runs-on: ubuntu-latest
101-
permissions:
102-
contents: write
103-
env:
104-
RELEASE_TAG: ""
105-
steps:
106-
- uses: actions/checkout@v4
107-
- name: Get Version
108-
id: GetVersion
109-
run: .\Scripts\getLatestVersion.ps1
110-
shell: pwsh
111-
- name: Create tag
112-
uses: rickstaa/action-create-tag@v1.7.2
113-
with:
114-
tag: ${{ steps.GetVersion.outputs.tag }}
115-
- name: Queue Git Release
116-
uses: benc-uk/workflow-dispatch@v1
117-
with:
118-
workflow: Git Release
119-
token: ${{ secrets.PERSONAL_TOKEN }}
120-
ref: ${{ steps.GetVersion.outputs.tag }}

.github/workflows/release-please.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
push:
3+
branches:
4+
- dev
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: release-bot
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: google-github-actions/release-please-action@v4
17+
with:
18+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
19+
config-file: release-please-config.json # Set to update gradle.properties, pom.xml & CHANGELOG.md
20+
manifest-file: .release-please-manifest.json
21+
target-branch: dev

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "6.6.0"
3+
}

CHANGELOG.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7-
8-
## [Unreleased]
9-
10-
### Added
11-
12-
### Changed
13-
145
## [6.6.0] - 2024-04-16
156

167
### Added

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,37 @@ Revisions of this nature will result in a 0.X.X change of the version number.
2525

2626
All the code of the current repository is being generated automatically by the [SDK generator](https://github.com/microsoftgraph/MSGraph-SDK-Code-Generator/) in which any change must be reflected.
2727

28+
## Commit message format
29+
30+
To support our automated release process, pull requests are required to follow the [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/)
31+
format.
32+
33+
Each commit message consists of a **header**, an optional **body** and an optional **footer**. The header is the first line of the commit and
34+
MUST have a **type** (see below for a list of types) and a **description**. An optional **scope** can be added to the header to give extra context.
35+
36+
```
37+
<type>[optional scope]: <short description>
38+
<BLANK LINE>
39+
<optional body>
40+
<BLANK LINE>
41+
<optional footer(s)>
42+
```
43+
44+
The recommended commit types used are:
45+
46+
- **feat** for feature updates (increments the _minor_ version)
47+
- **fix** for bug fixes (increments the _patch_ version)
48+
- **perf** for performance related changes e.g. optimizing an algorithm
49+
- **refactor** for code refactoring changes
50+
- **test** for test suite updates e.g. adding a test or fixing a test
51+
- **style** for changes that don't affect the meaning of code. e.g. formatting changes
52+
- **docs** for documentation updates e.g. ReadMe update or code documentation updates
53+
- **build** for build system changes (gradle updates, external dependency updates)
54+
- **ci** for CI configuration file changes e.g. updating a pipeline
55+
- **chore** for miscallaneous non-sdk changesin the repo e.g. removing an unused file
56+
57+
Adding a footer with the prefix **BREAKING CHANGE:** will cause an increment of the _major_ version.
58+
2859
## Add yourself as a contributor
2960

3061
This project follows the [all contributors](https://github.com/kentcdodds/all-contributors) specification. When making a contribution, please add yourself to the table of contributors:

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ repositories {
2020
2121
dependencies {
2222
// Include the sdk as a dependency
23+
// x-release-please-start-version
2324
implementation 'com.microsoft.graph:microsoft-graph:6.6.0'
25+
// x-release-please-end
2426
// This dependency is only needed if you are using a TokenCredential object for authentication
2527
implementation 'com.azure:azure-identity:1.11.0'
2628
}
@@ -35,7 +37,9 @@ Add the dependency in `dependencies` in pom.xml
3537
<!-- Include the sdk as a dependency -->
3638
<groupId>com.microsoft.graph</groupId>
3739
<artifactId>microsoft-graph</artifactId>
40+
<!--x-release-please-start-version-->
3841
<version>6.6.0</version>
42+
<!--x-release-please-end-->
3943
</dependency>
4044
<dependency>
4145
<!-- This dependency is only needed if you are using a TokenCredential object for authentication -->

Scripts/incrementMinorVersion.ps1

Lines changed: 0 additions & 64 deletions
This file was deleted.

gradle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ org.gradle.caching=true
2525

2626
mavenGroupId = com.microsoft.graph
2727
mavenArtifactId = microsoft-graph
28+
# x-release-please-start-major
2829
mavenMajorVersion = 6
30+
# x-release-please-end
31+
# x-release-please-start-minor
2932
mavenMinorVersion = 6
33+
# x-release-please-end
34+
# x-release-please-start-patch
3035
mavenPatchVersion = 0
36+
# x-release-please-end
3137
mavenArtifactSuffix =
3238

3339
#These values are used to run functional tests

release-please-config.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"bootstrap-sha": "6342ecd17b3c26f5d27b33ff49a2ceedc206f140",
3+
"exclude-paths": [
4+
".git",
5+
".idea",
6+
".github",
7+
".vscode"
8+
],
9+
"release-type": "java",
10+
"include-component-in-tag": false,
11+
"include-v-in-tag": true,
12+
"packages": {
13+
".": {
14+
"package-name": "com.microsoft.graph.microsoft-graph",
15+
"changelog-path": "CHANGELOG.md",
16+
"extra-files": [
17+
{
18+
"type": "generic",
19+
"path": "gradle.properties"
20+
},
21+
{
22+
"type": "generic",
23+
"path": "README.md"
24+
},
25+
{
26+
"type": "generic",
27+
"path": "src/main/java/com/microsoft/graph/info/Constants.java"
28+
},
29+
{
30+
"type": "xml",
31+
"path": "pom.xml",
32+
"xpath": "//project/version"
33+
}
34+
]
35+
}
36+
},
37+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
38+
}

src/main/java/com/microsoft/graph/info/Constants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
/** Multi-purpose constants holder used accross the SDK */
44
public final class Constants {
55
/** The SDK version */
6+
// x-release-please-start-version
67
public static final String VERSION_NAME = "6.6.0";
8+
// x-release-please-end
79
}
810

0 commit comments

Comments
 (0)