Skip to content

Commit

Permalink
setting up a github action to automate a new gem release
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinFisher committed Sep 12, 2024
1 parent da18943 commit 1e3a6bd
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/publish_gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish Gem

on:
workflow_dispatch:

permissions:
contents: write

jobs:
build_and_publish:
name: Build, tag & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.1

- name: Get version
id: version
run: |
VERSION=$(ruby -e "require './lib/tip_tap/version'; puts TipTap::VERSION")
echo "::set-output name=version::$VERSION"
- name: Create and push tag
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git tag v${{ steps.version.outputs.version }}
git push origin v${{ steps.version.outputs.version }}
- name: Run tests
run: |
bundle install
bundle exec rspec
- name: Build and 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 *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"

- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: Release ${{ steps.version.outputs.version }}
body: |
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md) for details.
draft: false
prerelease: false
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## [Unreleased]

## [0.9.8] - 2024-09-10

- Table support (Table, TableRow, TableCell, TableHeader)

## [0.9.6] - 2024-08-06

- Bump rexml version to 3.3.4 for CVE
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
tiptap-ruby (0.9.7)
tiptap-ruby (0.9.8)
actionview (>= 6.0)
activesupport (>= 6.0)

Expand Down
2 changes: 1 addition & 1 deletion lib/tip_tap/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module TipTap
VERSION = "0.9.7"
VERSION = "0.9.8"
end

0 comments on commit 1e3a6bd

Please sign in to comment.