Add release workflows (#240)

* Add release workflows

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Fix drafter

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Fix jenkins workflow

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Add credentials

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

* Fix jenkins lib version

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
This commit is contained in:
Sayali Gaikawad
2022-11-28 14:29:22 -08:00
committed by GitHub
parent dea10c80e5
commit e44c5f1a07
4 changed files with 51 additions and 1 deletions
+31
View File
@@ -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
View File
@@ -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))
+7 -1
View File
@@ -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
View File
@@ -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')
}