File tree Expand file tree Collapse file tree 2 files changed +20
-55
lines changed Expand file tree Collapse file tree 2 files changed +20
-55
lines changed Original file line number Diff line number Diff line change 1- name : Publish new version
1+ name : Create releases
22
33on :
4- workflow_dispatch :
4+ push :
5+ tags :
6+ - " v*"
57
6- jobs :
7- publish-gem :
8- name : Publish gem to rubygems.org
9-
10- if : github.repository == 'ruby-go-gem/go-gem-wrapper'
11- runs-on : ubuntu-latest
12-
13- defaults :
14- run :
15- shell : bash
16- working-directory : _gem/
17-
18- environment :
19- name : rubygems.org
20- url : https://rubygems.org/gems/go_gem
21-
22- permissions :
23- contents : write
24- id-token : write
25-
26- steps :
27- - name : Harden Runner
28- uses : step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
29- with :
30- egress-policy : audit
31-
32- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
33-
34- - name : Set up Ruby
35- uses : ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
36- with :
37- bundler-cache : true
38- ruby-version : ruby
39-
40- - name : Publish to RubyGems
41- uses : rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
42-
43- create-release :
44- needs :
45- - publish-gem
8+ permissions :
9+ contents : write
10+ actions : read
11+ pull-requests : read
4612
13+ jobs :
14+ publish :
4715 runs-on : ubuntu-latest
4816
49- permissions :
50- contents : write
51- actions : read
52- pull-requests : read
53-
5417 steps :
55- - name : Harden Runner
56- uses : step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
57- with :
58- egress-policy : audit
59-
6018 - uses : actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
6119
6220 - uses : ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
@@ -66,13 +24,13 @@ jobs:
6624
6725 - name : Generate changelog
6826 run : |
69- version=$(bundle exec ruby -e 'puts GoGem::VERSION')
70- bundle exec rake changelog[,v${version}] > /tmp/changelog.md
27+ bundle exec rake changelog[,${TAG_NAME}] > /tmp/changelog.md
7128 cat /tmp/changelog.md
7229 env :
30+ TAG_NAME : ${{ github.ref_name }}
7331 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7432
75- - name : Create release
33+ - name : Release
7634 uses : softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
7735 with :
7836 body_path : /tmp/changelog.md
Original file line number Diff line number Diff line change 99
1010Dir [ "#{ __dir__ } /_tasks/*.rake" ] . each { |f | load f }
1111
12+ desc "Release package"
13+ task :release do
14+ Dir . chdir ( File . join ( __dir__ , "_gem" ) ) do
15+ sh "rake release"
16+ end
17+ end
18+
1219desc "Generate changelog entry"
1320task :changelog , [ :before , :after ] do |_ , params |
1421 args = [ ]
You can’t perform that action at this time.
0 commit comments