Skip to content

Commit

Permalink
Merge pull request #139 from Mogztter/release-ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie authored Sep 13, 2020
2 parents 2c645d8 + af832fd commit d6a456e
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,7 @@ jobs:
run: |
npm run lint
npm t
publish-ruby:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Install and test
run: |
bundle install
bundle exec rake
working-directory: ./ruby
- name: Configure credentials
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > $HOME/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
- name: Build gem
run: |
bundle exec rake build
working-directory: ./ruby
- name: Publish to rubygems.org
run: |
gem push pkg/asciidoctor-kroki-${GITHUB_REF#refs/tags/v}.gem
working-directory: ./ruby
publish-js:
publish:
needs: build
runs-on: ubuntu-latest
steps:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/release-ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release Ruby

on:
push:
tags:
- 'ruby-v*' # Push events to matching ruby-v*, i.e. ruby-v1.0, ruby-v2.1.3

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- run: bundle install
working-directory: ./ruby
- run: bundle exec rake
working-directory: ./ruby
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'
- name: Install and test
run: |
bundle install
bundle exec rake
working-directory: ./ruby
- name: Configure credentials
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > $HOME/.gem/credentials
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
- name: Build gem
run: |
bundle exec rake build
working-directory: ./ruby
- name: Publish to rubygems.org
run: |
gem push pkg/asciidoctor-kroki-${GITHUB_REF#refs/tags/ruby-v}.gem
working-directory: ./ruby
# create the GitHub release
- name: Create release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
11 changes: 9 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Release

How to perform a release:
How to perform a release.

**Ruby:**

1. Update the version number `s.version` in `ruby/asciidoctor-kroki.gemspec`
2. Run `bundle exec rake` in the `ruby` directory to make sure that everything is working
3. Commit both `asciidoctor-kroki.gemspec` and `Gemfile.lock` files
4. Run `npm version x.y.z` at the root of the repository
4. Create a tag starting with `ruby-v` (eg. `ruby-v1.2.3`)
5. Push your changes with the tag: git push origin master --tags

**JavaScript:**

1. Run `npm version x.y.z` at the root of the repository
2. Push your changes with the tag: git push origin master --tags

0 comments on commit d6a456e

Please sign in to comment.