Skip to content

Commit c6a7494

Browse files
authored
Add release workflows (opensearch-project#188)
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
1 parent c574532 commit c6a7494

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Draft Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
draft_release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
contents: write
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v3
17+
- name: Install Ruby
18+
uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: jruby
21+
- name: Configure AWS credentials
22+
uses: aws-actions/configure-aws-credentials@v1
23+
with:
24+
role-to-assume: ${{ secrets.GET_SECRET_IAM_ROLE }}
25+
aws-region: us-east-1
26+
- name: Download signing key
27+
run: |
28+
aws secretsmanager get-secret-value --secret-id jenkins-opensearchproject-rubygems-private-key --query SecretString --output text > gem-private_key.pem
29+
- name: Build and package gem artifact
30+
run: |
31+
gem build logstash-output-opensearch.gemspec
32+
mkdir dist && mv logstash-output-opensearch-*.gem dist/
33+
tar -cvf artifacts.tar.gz dist
34+
- name: Draft a release
35+
uses: softprops/action-gh-release@v1
36+
with:
37+
draft: true
38+
generate_release_notes: true
39+
files: |
40+
artifacts.tar.gz

RELEASING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ Repositories create consistent release labels, such as `v1.0.0`, `v1.1.0` and `v
3333

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

36-
TODO
36+
1. Create a tag, e.g. 1.0.0, and push it to this GitHub repository.
37+
1. The [release-drafter.yml](.github/workflows/release-drafter.yml) will be automatically kicked off and a draft release will be created.
38+
1. This draft release triggers the [jenkins release workflow](https://build.ci.opensearch.org/job/logstash-ouput-opensearch-release) as a As a result of which the logstash-output-plugin is released on [rubygems.org](https://rubygems.org/gems/logstash-output-opensearch). Please note that the release workflow is triggered only if created release is in draft state.
39+
1. Once the above release workflow is successful, the drafted release on GitHub is published automatically.
40+
1. Increment "version" in [logstash-output-opensearch.gemspec](./logstash-output-opensearch.gemspec) to the next iteration, e.g. 1.0.1.

jenkins/release.jenkinsFile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
lib = library(identifier: 'jenkins@1.4.2', retriever: modernSCM([
2+
$class: 'GitSCMSource',
3+
remote: 'https://github.com/opensearch-project/opensearch-build-libraries.git',
4+
]))
5+
6+
standardReleasePipelineWithGenericTrigger(
7+
tokenIdCredential: 'jenkins-logstash-output-opensearch-generic-webhook-token',
8+
causeString: 'A tag was cut on opensearch-project/logstash-output-opensearch repository causing this workflow to run',
9+
downloadReleaseAsset: true,
10+
publishRelease: true) {
11+
publishToRubyGems(apiKeyCredentialId: 'jenkins-logstash-output-opensearch-api-key')
12+
}

0 commit comments

Comments
 (0)