File tree Expand file tree Collapse file tree 1 file changed +37
-14
lines changed
Expand file tree Collapse file tree 1 file changed +37
-14
lines changed Original file line number Diff line number Diff line change 1- name : Publish and Release Gem
1+ name : release
2+
23on :
3- push :
4- branches : [ $default-branch ]
5- paths : [ "VERSION" ]
64 workflow_dispatch :
5+ push :
6+ branches :
7+ - main
8+ paths :
9+ - lib/version.rb
10+
11+ permissions :
12+ contents : write
13+ packages : write
714
815jobs :
916 release :
1017 runs-on : ubuntu-latest
1118
1219 steps :
13- - name : Checkout
14- uses : actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
20+ - name : checkout
21+ uses : actions/checkout@v3
1522
16- - name : Setup Ruby
17- uses : ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251
23+ -
uses :
ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # [email protected] 1824 with :
1925 bundler-cache : true
2026
21- - name : Run Tests
27+ - name : bootstrap
28+ run : script/bootstrap
29+
30+ - name : lint
31+ run : bundle exec rubocop -c .rubocop.yml lib/ spec/
32+
33+ - name : test
2234 run : script/test
2335
24- - name : Build Gem
25- run : |
26- echo "GEM_VERSION=$(gem build entitlements-github-plugin.gemspec 2>&1 | grep Version | cut -d':' -f 2 | tr -d " \t\n\r")" >> $GITHUB_ENV
36+ - name : set GEM_NAME from gemspec
37+ run : echo "GEM_NAME=$(ls | grep gemspec | cut -d. -f1)" >> $GITHUB_ENV
38+
39+ # builds the gem and saves the version to GITHUB_ENV
40+ - name : build
41+ run : echo "GEM_VERSION=$(gem build ${{ env.GEM_NAME }}.gemspec 2>&1 | grep Version | cut -d':' -f 2 | tr -d " \t\n\r")" >> $GITHUB_ENV
2742
28- - name : Publish to GitHub Packages
43+ - name : publish to GitHub packages
2944 run : |
30- GEM_HOST_API_KEY=${{ secrets.GITHUB_TOKEN }} gem push --KEY github --host https://rubygems.pkg.github.com/github entitlements-github-plugin-${{ env.GEM_VERSION }}.gem
45+ export OWNER=$( echo ${{ github.repository }} | cut -d "/" -f 1 )
46+ GEM_HOST_API_KEY=${{ secrets.GITHUB_TOKEN }} gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} ${{ env.GEM_NAME }}-${{ env.GEM_VERSION }}.gem
47+
48+ - name : release
49+ uses :
ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # [email protected] 50+ with :
51+ artifacts : " ${{ env.GEM_NAME }}-${{ env.GEM_VERSION }}.gem"
52+ tag : " v${{ env.GEM_VERSION }}"
53+ generateReleaseNotes : true
You can’t perform that action at this time.
0 commit comments