Skip to content

Commit

Permalink
cleanup and removing unnecessary steps (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinFisher authored Sep 12, 2024
1 parent 31e66a4 commit 0b5bc30
Showing 1 changed file with 30 additions and 49 deletions.
79 changes: 30 additions & 49 deletions .github/workflows/publish_gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,38 @@ on:
workflow_dispatch:

jobs:
build_and_publish:
name: Build, tag & publish
publish_and_release:
name: Publish gem to RubyGems.org and create a GitHub Release
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Get version
id: version
run: |
VERSION=$(ruby -e "require './lib/tip_tap/version'; puts TipTap::VERSION")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create tag
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git tag v${{ steps.version.outputs.version }}
- name: Push tag
run: git push origin v${{ steps.version.outputs.version }}

- name: Install dependencies
run: bundle install

- name: Run tests
run: bundle exec rspec

- name: Publish to RubyGems
uses: rubygems/release-gem@v1

- 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
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby

- uses: rubygems/release-gem@v1

- name: Get version
id: version
run: |
VERSION=$(ruby -e "require './lib/tip_tap/version'; puts TipTap::VERSION")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- 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

0 comments on commit 0b5bc30

Please sign in to comment.