Skip to content

Commit

Permalink
Add workflow to publish gem on tag. (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething authored Oct 7, 2021
1 parent bb10a1c commit 48b9e62
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Ruby Gem

on:
push:
tags:
- 'v*'

jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: 2.7.x

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build droplet_kit.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
11 changes: 4 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@
Once the changes have been merged to main it's time to release a new
version of the gem.

1. Creating a PR with a semantic version
bump to
1. Creating a PR with a semantic version bump to
[version](https://github.com/digitalocean/droplet_kit/blob/main/lib/droplet_kit/version.rb)
and all the changes being released added to the
[CHANGELOG](https://github.com/digitalocean/droplet_kit/blob/main/CHANGELOG.md).
1. After the PR has been merged, create a release
on github for the new version:
- The tag should be in the format of: vX.Y.Z
1. After the PR has been merged, create a release on GitHub for the new version:
- The tag should be in the format of: vX.Y.Z
- You can think of X.Y.Z as such:
X = breaking
Y = feature
Z = bugfix
- The title should be in the format of: vX.Y.Z (same as tag)
- The description should include all the changes being released in the format of:
- #[PR #] - @[contributor] - [description]
1. The release will be pushed to rubygems by a concourse job. Concourse checks the
repo for a new release every 5 minutes, so there's a slight delay.
1. When the tag is created, a GitHub Actions workflow will publish the release to rubygems.

0 comments on commit 48b9e62

Please sign in to comment.