Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Add release workflows #84

Merged
merged 1 commit into from
Feb 16, 2023
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:
lint:
runs-on: ubuntu-20.04
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: Draft a 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 @@ -5,6 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Added
- Github workflow for changelog verification ([#81](https://github.com/opensearch-project/opensearch-dsl-py/pull/81))
- Added AttrDict .get(...) method ([#90](https://github.com/opensearch-project/opensearch-dsl-py/pull/90))
- Add release workflows ([#84](https://github.com/opensearch-project/opensearch-dsl-py/pull/84))

### Changed

Expand Down
9 changes: 8 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,11 @@ 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-dsl-py-release/) as a result of which opensearch-dsl-py client is released on [PyPi](https://pypi.org/project/opensearch-dsl/).
1. Once the above release workflow is successful, the drafted release on GitHub is published automatically.
1. Increment "VERSION" in [__init__.py](./opensearch_dsl/__init__.py) and [setup.py](./setup.py) to the next patch release, e.g. v2.1.1. See [example](https://github.com/opensearch-project/opensearch-dsl-py/pull/55).

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: '[email protected]', retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
]))

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