From 78ecc09e7f4c2a0dd25faadb9c8f9b74266e3988 Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Wed, 30 Nov 2022 12:55:30 -0800 Subject: [PATCH 1/4] Add release workflows Signed-off-by: Sayali Gaikawad --- .github/workflows/release-drafter.yml | 18 ++++++++++++++++++ CHANGELOG.md | 4 +++- jenkins/release.JenkinsFile | 11 +++++++++++ package.json | 2 +- 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release-drafter.yml create mode 100644 jenkins/release.JenkinsFile diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000000..0a973d2106 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,18 @@ +name: Draft a release + +on: + push: + tags: + - "*" + +jobs: + draft_release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: true + generate_release_notes: true \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 17f645da70..178af00570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # OUI -## [`master`](https://github.com/opensearch-project/oui/tree/master) +## [`main`](https://github.com/opensearch-project/oui/tree/main) + +- Add release workflows ([134](https://github.com/opensearch-project/oui/pull/133)) ## [`1.0.0`](https://github.com/opensearch-project/oui/tree/1.0.0) diff --git a/jenkins/release.JenkinsFile b/jenkins/release.JenkinsFile new file mode 100644 index 0000000000..4d9bc7a33f --- /dev/null +++ b/jenkins/release.JenkinsFile @@ -0,0 +1,11 @@ +lib = library(identifier: 'jenkins@1.1.1', retriever: modernSCM([ + $class: 'GitSCMSource', + remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git', +])) + +standardReleasePipelineWithGenericTrigger( + tokenIdCredential: 'jenkins-opensearch-js-generic-webhook-token', + causeString: 'A tag was cut on opensearch-project/opensearch-js repository causing this workflow to run', + publishRelease: true) { + publishToNpm(repository: 'https://github.com/opensearch-project/opensearch-js', tag: "$tag") + } diff --git a/package.json b/package.json index e9f632ed47..11ee6beace 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@opensearch-project/oui", + "name": "sayali-test-oui", "description": "OpenSearch UI Component Library", "version": "1.0.0", "license": "Apache-2.0", From 75119741a3eb017663f2c899421d66463fdb39aa Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Wed, 30 Nov 2022 12:59:14 -0800 Subject: [PATCH 2/4] test Signed-off-by: Sayali Gaikawad --- jenkins/release.JenkinsFile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/release.JenkinsFile b/jenkins/release.JenkinsFile index 4d9bc7a33f..8116276a7d 100644 --- a/jenkins/release.JenkinsFile +++ b/jenkins/release.JenkinsFile @@ -5,7 +5,7 @@ lib = library(identifier: 'jenkins@1.1.1', retriever: modernSCM([ standardReleasePipelineWithGenericTrigger( tokenIdCredential: 'jenkins-opensearch-js-generic-webhook-token', - causeString: 'A tag was cut on opensearch-project/opensearch-js repository causing this workflow to run', + causeString: 'A tag was cut on opensearch-project/oui repository causing this workflow to run', publishRelease: true) { - publishToNpm(repository: 'https://github.com/opensearch-project/opensearch-js', tag: "$tag") + publishToNpm(repository: 'https://github.com/gaiksaya/oui', tag: "$tag") } From 13d5a2589d948cb9a5e622b31ca85c8382fe7d75 Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Wed, 30 Nov 2022 13:06:21 -0800 Subject: [PATCH 3/4] test Signed-off-by: Sayali Gaikawad --- jenkins/release.JenkinsFile | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jenkins/release.JenkinsFile b/jenkins/release.JenkinsFile index 8116276a7d..fb6bebfb96 100644 --- a/jenkins/release.JenkinsFile +++ b/jenkins/release.JenkinsFile @@ -4,8 +4,8 @@ lib = library(identifier: 'jenkins@1.1.1', retriever: modernSCM([ ])) standardReleasePipelineWithGenericTrigger( - tokenIdCredential: 'jenkins-opensearch-js-generic-webhook-token', + tokenIdCredential: 'jenkins-oui-generic-webhook-token', causeString: 'A tag was cut on opensearch-project/oui repository causing this workflow to run', publishRelease: true) { - publishToNpm(repository: 'https://github.com/gaiksaya/oui', tag: "$tag") + publishToNpm(repository: 'https://github.com/opensearch-project/oui', tag: "$tag") } diff --git a/package.json b/package.json index 11ee6beace..e9f632ed47 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "sayali-test-oui", + "name": "@opensearch-project/oui", "description": "OpenSearch UI Component Library", "version": "1.0.0", "license": "Apache-2.0", From aaa0a375183612c0a8af0c7a024a221637e5583e Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Wed, 30 Nov 2022 16:31:31 -0800 Subject: [PATCH 4/4] Add releasing.md file Signed-off-by: Sayali Gaikawad --- RELEASING.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 RELEASING.md diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000000..442aa09c3d --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,40 @@ +- [Overview](#overview) +- [Branching](#branching) + - [Release Branching](#release-branching) + - [Feature Branches](#feature-branches) +- [Release Labels](#release-labels) +- [Releasing](#releasing) + +## Overview + +This document explains the release strategy for artifacts in this organization. + +## Branching + +### Release Branching + +Given the current major release of 1.0, projects in this organization maintain the following active branches. + +- **main**: The next _major_ release. This is the branch where all merges take place and code moves fast. +- **1.x**: The next _minor_ release. Once a change is merged into `main`, decide whether to backport it to `1.x`. +- **1.0**: The _current_ release. In between minor releases, only hotfixes (e.g. security) are backported to `1.0`. + +Label PRs with the next major version label (e.g. `2.0.0`) and merge changes into `main`. Label PRs that you believe need to be backported as `1.x` and `1.0`. Backport PRs by checking out the versioned branch, cherry-pick changes and open a PR against each target backport branch. + +### Feature Branches + +Do not create branches in the upstream repo, use your fork, for the exception of long lasting feature branches that require active collaboration from multiple developers. Name feature branches `feature/`. Once the work is merged to `main`, please make sure to delete the feature branch. + +## Release Labels + +Repositories create consistent release labels, such as `v1.0.0`, `v1.1.0` and `v2.0.0`, as well as `patch` and `backport`. Use release labels to target an issue or a PR for a given release. + +## Releasing + +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/oui-release/) as a result of which OUI is released on [npmjs](https://www.npmjs.com/package/@opensearch-project/oui). +1. Once the above release workflow is successful, the drafted release on GitHub is published automatically. +1. Increment "version" in package.json to the next patch release, e.g. v2.1.1. See [example](https://github.com/opensearch-project/opensearch-js/pull/318) \ No newline at end of file