Skip to content

Commit 092c7ab

Browse files
authored
Create gem.yml
1 parent e37a9d9 commit 092c7ab

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/gem.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish and Release Gem
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- "VERSION"
8+
workflow_dispatch:
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
17+
18+
- name: Setup Ruby
19+
uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251
20+
with:
21+
bundler-cache: true
22+
23+
- name: Run Tests
24+
run: script/test
25+
26+
- name: Build Gem
27+
run: |
28+
echo "GEM_VERSION=$(gem build entitlements-gitrepo-auditor-plugin.gemspec 2>&1 | grep Version | cut -d':' -f 2 | tr -d " \t\n\r")" >> $GITHUB_ENV
29+
- name: Publish to GitHub Packages
30+
run: |
31+
GEM_HOST_API_KEY=${{ secrets.GITHUB_TOKEN }} gem push --KEY github --host https://rubygems.pkg.github.com/github entitlements-gitrepo-auditor-plugin-${{ env.GEM_VERSION }}.gem

0 commit comments

Comments
 (0)