Skip to content

Commit 648132a

Browse files
authored
Merge pull request #21 from fastruby/feature/add-release-workflow
chore(workflow): Add release workflow
2 parents 15ece6e + d4bb10f commit 648132a

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
release-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Update Release PR
13+
uses: google-github-actions/release-please-action@v3
14+
id: release
15+
with:
16+
release-type: ruby
17+
package-name: ombu_labs-auth
18+
version-file: "lib/ombu_labs/auth/version.rb"
19+
changelog-types: '[{"type":"feat","section":"Features","hidden":false}, {"type":"fix","section":"Bug Fixes","hidden":false}, {"type":"chore", "section":"Miscellaneous","hidden":false}]'
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
if: ${{ steps.release.outputs.release_created }}
23+
- name: Set Up Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
bundle-cache: true
27+
if: ${{ steps.release.outputs.release_created }}
28+
- name: Bundle Install
29+
run: bundle install
30+
if: ${{ steps.release.outputs.release_created }}
31+
- name: Publish to GitHub
32+
run: |
33+
mkdir -p $HOME/.gem
34+
touch $HOME/.gem/credentials
35+
chmod 0600 $HOME/.gem/credentials
36+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
37+
gem build *.gemspec
38+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
39+
env:
40+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
41+
OWNER: ${{ github.repository_owner }}
42+
if: ${{ steps.release.outputs.release_created }}
43+
- name: Publish to RubyGems
44+
run: |
45+
mkdir -p $HOME/.gem
46+
touch $HOME/.gem/credentials
47+
chmod 0600 $HOME/.gem/credentials
48+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
49+
gem build *.gemspec
50+
gem push *.gem
51+
env:
52+
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"
53+
if: ${{ steps.release.outputs.release_created }}

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,22 @@ Have a fix for a problem you've been running into or an idea for a new feature y
159159

160160
Take a look at the [Contributing document](https://github.com/fastruby/ombu_labs-auth/blob/main/CONTRIBUTING.md) for instructions to set up the repo on your machine and create a good Pull Request.
161161

162+
## Release
163+
164+
If you are looking to contribute in the gem you need to be aware that we are using the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification to release versions in this gem.
165+
166+
which means, when doing a contribution your commit message must have the following structure
167+
168+
```git
169+
<type>[optional scope]: <description>
170+
171+
[optional body]
172+
173+
[optional footer(s)]
174+
```
175+
176+
[here](https://www.conventionalcommits.org/en/v1.0.0/#examples) you can find some commit's examples.
177+
162178
## License
163179

164180
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)