File tree 3 files changed +39
-7
lines changed
3 files changed +39
-7
lines changed Original file line number Diff line number Diff line change 1
- name : Update the v1 branch when a release is published
1
+ name : Create a Release
2
2
on :
3
- release :
4
- types : [published]
3
+ workflow_dispatch :
5
4
permissions :
6
- contents : read
5
+ contents : write # for creating release
7
6
8
7
jobs :
9
8
release :
10
9
runs-on : ubuntu-latest
11
- permissions :
12
- contents : write # for git push
13
10
steps :
14
11
- uses : actions/checkout@v4
15
12
with :
16
13
fetch-depth : 0
17
- - run : git push origin HEAD:v1
14
+ - uses : ./
15
+ with :
16
+ ruby-version : ' 3.3'
17
+ - run : ruby release.rb
Original file line number Diff line number Diff line change
1
+ name : Update the v1 branch when a release is published
2
+ on :
3
+ release :
4
+ types : [published]
5
+ permissions :
6
+ contents : write # for git push
7
+
8
+ jobs :
9
+ update_branch :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v4
13
+ with :
14
+ fetch-depth : 0
15
+ - run : git push origin HEAD:v1
Original file line number Diff line number Diff line change
1
+ require 'json'
2
+
3
+ def run ( command_line )
4
+ puts "$ #{ command_line } "
5
+ output = `#{ command_line } `
6
+ puts output
7
+ raise $?. inspect unless $?. success?
8
+ output
9
+ end
10
+
11
+ latest_release_tag = run 'gh release view --json tagName'
12
+ latest_release_tag = JSON . load ( latest_release_tag ) . fetch ( 'tagName' )
13
+
14
+ raise latest_release_tag unless latest_release_tag =~ /\A v(\d +).(\d +).(\d +)\z /
15
+ tag = "v#{ $1} .#{ Integer ( $2) +1 } .0"
16
+
17
+ run "gh release create --generate-notes --latest #{ tag } "
You can’t perform that action at this time.
0 commit comments