Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release workflows #240

Merged
merged 5 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release drafter

on:
push:
tags:
- "*"

jobs:
draft-a-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install build tools
run: |
python -m pip install --upgrade build
- name: Build project for distribution
run: |
python -m build
tar -zvcf artifacts.tar.gz dist
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: true
files: |
artifacts.tar.gz
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added Point in time API rest API([#191](https://github.com/opensearch-project/opensearch-py/pull/191))
- Github workflow for changelog verification ([#218](https://github.com/opensearch-project/opensearch-py/pull/218))
- Added overload decorators to helpers-actions.pyi-"bulk" ([#239](https://github.com/opensearch-project/opensearch-py/pull/239))
- Add release workflows ([#240](https://github.com/opensearch-project/opensearch-py/pull/240))
### Changed
- Updated getting started to user guide ([#233](https://github.com/opensearch-project/opensearch-py/pull/233))
- Updated CA certificate handling to check OpenSSL environment variables before defaulting to certifi ([#196](https://github.com/opensearch-project/opensearch-py/pull/196))
Expand Down
8 changes: 7 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ Repositories create consistent release labels, such as `v1.0.0`, `v1.1.0` and `v

## Releasing

The release process is standard across repositories in this org and is run by a release manager volunteering from amongst [MAINTAINERS](MAINTAINERS.md).
The release process is standard across repositories in this org and is run by a release manager volunteering from amongst [maintainers](MAINTAINERS.md).

1. Create a tag, e.g. v2.1.0, and push it to the GitHub repo.
1. The [release-drafter.yml](.github/workflows/release-drafter.yml) will be automatically kicked off and a draft release will be created.
1. This draft release triggers the [jenkins release workflow](https://build.ci.opensearch.org/job/opensearch-py-release/) as a result of which opensearch-py client is released on [PyPi](https://pypi.org/project/opensearch-py/).
1. Once the above release workflow is successful, the drafted release on GitHub is published automatically.
1. Increment "version" in [_version.py](./opensearchpy/_version.py) to the next patch release, e.g. v2.1.1. See [example](https://github.com/opensearch-project/opensearch-py/pull/167).
12 changes: 12 additions & 0 deletions jenkins/release.JenkinsFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
lib = library(identifier: 'jenkins@1.3.1', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
]))

standardReleasePipelineWithGenericTrigger(
tokenIdCredential: 'jenkins-opensearch-py-generic-webhook-token',
causeString: 'A tag was cut on opensearch-project/opensearch-py repository causing this workflow to run',
downloadReleaseAsset: true,
publishRelease: true) {
publishToPyPi(credentialId: 'jenkins-opensearch-py-pypi-credentials')
}