Skip to content

Commit 2231788

Browse files
committed
chore: manually publish gem
- add CONTRIBUTING.md (contributers should use conventional commits) - doc.yml: only publish pages on release - publish-gem.yml: input OTP code when publishing to rubygems.org - add links section to README
1 parent 2e3bec9 commit 2231788

File tree

7 files changed

+139
-20
lines changed

7 files changed

+139
-20
lines changed

.github/CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contributing to Ruby Graph Library
2+
3+
Thank you for your interest in contributing to rgl! We welcome all
4+
contributions, whether they're big or small. Here are some guidelines to get you
5+
started.
6+
7+
## Code of Conduct
8+
9+
Please note that this project is released with a Contributor Code of Conduct. By
10+
participating in this project you agree to abide by its terms.
11+
12+
## How to Contribute
13+
14+
1. Fork the repository.
15+
2. Create a branch for your changes: `git checkout -b my-feature-branch`
16+
3. Make your changes and commit them with descriptive commit messages.
17+
4. Ensure that tests pass by running `bundle exec rake` locally.
18+
5. Push your changes to your fork: `git push origin my-feature-branch`
19+
6. Submit a pull request with your changes.
20+
21+
## Commit Guidelines
22+
23+
We follow the [Conventional
24+
Commits](https://www.conventionalcommits.org/en/v1.0.0/) guidelines for commit
25+
messages in this repository. Please ensure that all commit messages follow the
26+
format:
27+
28+
```
29+
<type>[optional scope]: <description>
30+
31+
[optional body]
32+
33+
[optional footer(s)]
34+
```
35+
36+
Where:
37+
- =<type>=: The type of change being made (e.g. feat, fix, docs, style, refactor, test, chore)
38+
- =<scope>= (optional): The scope of the change (e.g. component name, file name)
39+
- =<description>=: A brief description of the change
40+
- =[optional body]=: A more detailed description of the change
41+
- =[optional footer(s)]=: Any important information related to the change, such
42+
as a breaking change note
43+
44+
By following these guidelines, it will be easier to understand the purpose of
45+
each commit and track changes over time.
46+
47+
Please note that we may ask you to amend your commit message(s) if they do not
48+
follow these guidelines.
49+
50+
## Issue Tracker
51+
52+
If you find a bug or want to request a new feature, please create an issue in
53+
the GitHub issue tracker. Please provide as much detail as possible, including
54+
steps to reproduce the issue (if applicable).
55+
56+
## Code Reviews
57+
58+
All submissions, including submissions by project members, require review. We
59+
use GitHub pull requests for this purpose. Consult [GitHub
60+
Help](https://help.github.com/articles/about-pull-requests/) for more
61+
information on using pull requests.
62+
63+
## License
64+
65+
By contributing, you agree that your contributions will be licensed under the
66+
[Ruby License](../LICENSE).

.github/workflows/doc.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
2-
name: Doc
2+
name: Publish Documentation
33

44
on:
5-
push:
6-
branches:
7-
- "master"
5+
release:
6+
types: [published]
87

98
# Allows you to run this workflow manually from the Actions tab
109
workflow_dispatch:
@@ -25,6 +24,8 @@ jobs:
2524
runs-on: ubuntu-latest
2625
steps:
2726
- uses: actions/checkout@v3
27+
with:
28+
ref: ${{ github.ref }}
2829
- name: Set up Ruby
2930
uses: ruby/setup-ruby@v1
3031
with:

.github/workflows/publish-gem.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Push to rubygems.org
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
rubygems-otp-code:
7+
description: RubyGems OTP code
8+
required: true
9+
type: string
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
env:
15+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
16+
GEM_HOST_OTP_CODE: ${{ github.event.inputs.rubygems-otp-code }}
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- uses: ruby/setup-ruby@v1
23+
with:
24+
bundler-cache: true
25+
26+
- name: config
27+
run: |
28+
git config --global user.name "${GITHUB_ACTOR}"
29+
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
30+
31+
- name: release
32+
run: bundle exec rake release

.github/workflows/release.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# .github/workflows/release.yml
33
# Adapted from: https://blog.dennisokeeffe.com/blog/2022-03-19-automating-rubygem-package-releases-with-github-actions
4-
name: Release
4+
name: Prepare Release
55

66
on:
77
push:
@@ -45,15 +45,20 @@ jobs:
4545
run: |
4646
bundle exec rake test
4747
if: ${{ steps.release.outputs.release_created }}
48-
# Publish
49-
- name: publish gem
48+
49+
- name: Build docs
5050
run: |
51-
mkdir -p $HOME/.gem
52-
touch $HOME/.gem/credentials
53-
chmod 0600 $HOME/.gem/credentials
54-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
55-
gem build *.gemspec
56-
gem push *.gem
57-
env:
58-
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
59-
if: ${{ steps.release.outputs.release_created }}
51+
bundle exec rake yard || true
52+
if: ${{ steps.release.outputs.release_created }}
53+
# Publishing to rubygems.org is done in publish-gem.yml in a manual step. Needs OTP.
54+
# - name: publish gem
55+
# run: |
56+
# mkdir -p $HOME/.gem
57+
# touch $HOME/.gem/credentials
58+
# chmod 0600 $HOME/.gem/credentials
59+
# printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
60+
# gem build *.gemspec
61+
# gem push *.gem
62+
# env:
63+
# GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
64+
# if: ${{ steps.release.outputs.release_created }}

.yardopts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
-
88
examples/*.rb
99
rakelib/dep_graph.rake
10-
ChangeLog
10+
CHANGELOG.md
11+

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,25 @@ Jeremy Bopp, John Carter, Sascha Doerdelmann, Shawn Garbett, Andreas
287287
Schörk, Dan Čermák, Kirill Lashuk and Markus Napp for contributing additions, test
288288
cases and bugfixes.
289289

290-
See also: https://github.com/monora/rgl/contributors
290+
See also the [list of contributers][5]
291+
292+
## Links
293+
294+
- See [CHANGELOG.md][1] for major/breaking updates, and [releases][2] for a
295+
detailed version history.
296+
- To **contribute**, please read [CONTRIBUTING.md][4] first.
297+
- Please [open an issue][3] if anything is missing or unclear in this
298+
documentation.
291299

292300
## Copying
293301

294302
RGL is Copyright (c) 2002,2004,2005,2008,2013,2015,2019,2020,2022,2023 by Horst
295303
Duchene. It is free software, and may be redistributed under the [Ruby
296-
license](https://en.wikipedia.org/wiki/Ruby_License) and terms specified in
304+
license](.LICENSE) and terms specified in
297305
the LICENSE file.
306+
307+
[1] ./CHANGELOG.md
308+
[2] https://github.com/monora/rgl/releases
309+
[3] https://github.com/monora/rgl/issues/new
310+
[4] ./.github/CONTRIBUTING.md
311+
[5] https://github.com/monora/rgl/contributors

rgl.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
2222

2323
s.files = Dir[
2424
'lib/**/*.rb',
25-
'ChangeLog',
25+
'CHANGELOG.md',
2626
'examples/**/*',
2727
'Gemfile',
2828
'README.md',

0 commit comments

Comments
 (0)