Skip to content
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
40 changes: 40 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Draft Release

on:
push:
tags:
- "*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this automatically set the version to 2.0.1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is just a trigger. Any tag pushed to this repo will trigger this workflow


jobs:
draft_release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: jruby
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.GET_SECRET_IAM_ROLE }}
aws-region: us-east-1
- name: Download signing key
run: |
aws secretsmanager get-secret-value --secret-id jenkins-opensearchproject-rubygems-private-key --query SecretString --output text > gem-private_key.pem
- name: Build and package gem artifact
run: |
gem build logstash-output-opensearch.gemspec
mkdir dist && mv logstash-output-opensearch-*.gem dist/
tar -cvf 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
6 changes: 5 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ Repositories create consistent release labels, such as `v1.0.0`, `v1.1.0` and `v

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

TODO
1. Create a tag, e.g. 1.0.0, and push it to this GitHub repository.
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/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.
1. Once the above release workflow is successful, the drafted release on GitHub is published automatically.
1. Increment "version" in [logstash-output-opensearch.gemspec](./logstash-output-opensearch.gemspec) to the next iteration, e.g. 1.0.1.
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-logstash-output-opensearch-generic-webhook-token',
causeString: 'A tag was cut on opensearch-project/logstash-output-opensearch repository causing this workflow to run',
downloadReleaseAsset: true,
publishRelease: true) {
publishToRubyGems(apiKeyCredentialId: 'jenkins-logstash-output-opensearch-api-key')
}