Skip to content

Commit a058ada

Browse files
VachaShahgaiksaya
andauthored
Add 2PR approval to release workflow (#383) (#394)
Signed-off-by: Sayali Gaikawad <[email protected]> Signed-off-by: Vacha Shah <[email protected]> Co-authored-by: Sayali Gaikawad <[email protected]>
1 parent 2e7de62 commit a058ada

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.github/workflows/release-drafter.yml

+12
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ jobs:
1212
steps:
1313
- name: Checkout code
1414
uses: actions/checkout@v3
15+
- id: get_data
16+
run: |
17+
echo "approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '* ' | sed 's/@/,/g' | sed 's/,//1')" >> $GITHUB_OUTPUT
18+
echo "version=$(cat gradle.properties | grep "systemProp.version" | cut -d'=' -f2)" >> $GITHUB_OUTPUT
19+
- uses: trstringer/manual-approval@v1
20+
with:
21+
secret: ${{ github.TOKEN }}
22+
approvers: ${{ steps.get_data.outputs.approvers }}
23+
minimum-approvals: 2
24+
issue-title: 'Release opensearch-java : ${{ steps.get_data.outputs.version }}'
25+
issue-body: "Please approve or deny the release of opensearch-java. **VERSION**: ${{ steps.get_data.outputs.version }} **TAG**: ${{ github.ref_name }} **COMMIT**: ${{ github.sha }}"
26+
exclude-workflow-initiator-as-approver: true
1527
- name: Set up JDK 11
1628
uses: actions/setup-java@v1
1729
with:

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
99
- Add support for signing service name in AwsSdk2Transport ([#324](https://github.com/opensearch-project/opensearch-java/pull/324))
1010
- Add new OpenSearchTransport based on Apache HttpClient 5 ([#328](https://github.com/opensearch-project/opensearch-java/pull/328))
1111
- Add 1-click release workflows ([#321](https://github.com/opensearch-project/opensearch-java/pull/321))
12+
- Require two maintainers to approve release ([#383](https://github.com/opensearch-project/opensearch-java/pull/383))
1213

1314
### Dependencies
1415
- Bumps `grgit-gradle` from 4.0.1 to 5.0.0

RELEASING.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,7 @@ Repositories create consistent release labels, such as `v1.0.0`, `v1.1.0` and `v
3434
The release process is standard across repositories in this org and is run by a release manager volunteering from amongst [MAINTAINERS](MAINTAINERS.md).
3535

3636
1. Create a tag, e.g. `v2.1.0`, and push it to the GitHub repo.
37-
2. This creates a draft release which triggers the [opensearch-java-maven-sign-and-release/](https://build.ci.opensearch.org/job/opensearch-java-maven-sign-and-release/) jenkins workflow. The artifacts will be automcatically signed and published to maven.
38-
3. Increment `systemProp.version` in [gradle.properties](gradle.properties) to the next patch release, e.g. `v2.1.1`, commit and push.
37+
1. The [release-drafter.yml](.github/workflows/release-drafter.yml) will be automatically kicked off and is responsible for drafting a new release on GitHub containing release artifacts.
38+
1. Before creating a draft release, this workflow creates a GitHub issue asking for approval from the [maintainers](MAINTAINERS.md). See sample [issue](https://github.com/gaiksaya/opensearch-java/issues/1). The maintainers need to approve in order to continue the workflow run.
39+
1. Once a release is drafted [opensearch-java-maven-sign-and-release/](https://build.ci.opensearch.org/job/opensearch-java-maven-sign-and-release/) jenkins workflow is triggered. The artifacts will be automcatically signed and published to maven.
40+
1. Increment `systemProp.version` in [gradle.properties](gradle.properties) to the next patch release, e.g. `v2.1.1`, commit and push.

0 commit comments

Comments
 (0)