Skip to content

Commit

Permalink
ci: publish on tag in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzej-stencel committed Feb 14, 2024
1 parent 0f8f5c8 commit 75fcdff
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'

jobs:
publish:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4

- name: Build
run: gem build fluent-plugin-sumologic_output.gemspec
- name: Publish
env:
GEM_HOST_API_KEY: ${{ secrets.RUGYGEMS_APIKEY }}
run: gem push fluent-plugin-sumologic_output-*.gem
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing

## How to release

1. Create a pull request named `chore: release x.y.z` with the following changes:

- Set `gem.version` to `"x.y.z"` in [fluent-plugin-sumologic_output.gemspec](fluent-plugin-sumologic_output.gemspec).
- Add new version to [CHANGELOG.md](./CHANGELOG.md).

2. Create and push the release tag:

```bash
git checkout main
git pull
export VERSION=x.y.z
git tag -a "v${VERSION}" -m "Release v${VERSION}"
git push origin "v${VERSION}"
```

This will trigger the GitHub Actions [publish](./.github/workflows/publish.yaml) action to pubilsh the gem in Ruby Gems.

3. Go to https://github.com/SumoLogic/fluentd-output-sumologic/releases and create a new release for the tag.
Copy the changes from Changelog and publish the release.
2 changes: 1 addition & 1 deletion fluent-plugin-sumologic_output.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |gem|
gem.name = "fluent-plugin-sumologic_output"
gem.version = "0.0.0"
gem.version = "1.8.0"
gem.authors = ["Steven Adams", "Frank Reno"]
gem.email = ["[email protected]", "[email protected]"]
gem.description = %q{Output plugin to SumoLogic HTTP Endpoint}
Expand Down

0 comments on commit 75fcdff

Please sign in to comment.