-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup and removing unnecessary steps (#29)
- Loading branch information
1 parent
31e66a4
commit 0b5bc30
Showing
1 changed file
with
30 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 "[email protected]" | ||
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 |