@@ -2,32 +2,24 @@ name: "BSON Release"
22run-name : " BSON Release for ${{ github.ref }}"
33
44on :
5+ # for auto-deploy when merging a release-candidate PR
6+ push :
7+ branches :
8+ - ' master'
9+ - ' *-stable'
10+
11+ # for manual release
512 workflow_dispatch :
613 inputs :
7- dry_run :
8- description : Whether this is a dry run or not
14+ pr :
15+ description : " The number of the merged release candidate PR "
916 required : true
10- default : true
11- type : boolean
1217
1318env :
1419 SILK_ASSET_GROUP : bson-ruby
15- RELEASE_MESSAGE_TEMPLATE : |
16- Version {0} of [BSON for Ruby](https://rubygems.org/gems/bson) is now available.
17-
18- **Release Highlights**
19-
20- TODO: one or more paragraphs describing important changes in this release
21-
22- **Documentation**
23-
24- Documentation is available at [MongoDB.com](https://www.mongodb.com/docs/ruby-driver/current/tutorials/bson/).
25-
26- **Installation**
27-
28- You may install this version via RubyGems, with:
29-
30- gem install --version {0} bson
20+ GEM_NAME : bson
21+ PRODUCT_NAME : BSON for Ruby
22+ PRODUCT_ID : mongodb-ruby-driver
3123
3224permissions :
3325 # required for all workflows
@@ -38,133 +30,63 @@ permissions:
3830
3931 # only required for workflows in private repositories
4032 actions : read
33+ pull-requests : read
4134 contents : write
4235
4336 # required by the mongodb-labs/drivers-github-tools/setup@v2 step
4437 # also required by `rubygems/release-gem`
4538 id-token : write
4639
4740jobs :
41+ check :
42+ name : " Check Release"
43+ runs-on : ubuntu-latest
44+ outputs :
45+ message : ${{ steps.check.outputs.message }}
46+ ref : ${{ steps.check.outputs.ref }}
47+ steps :
48+ - name : " Run the check action"
49+ id : check
50+ uses : jamis/drivers-github-tools/ruby/pr-check@ruby-3643-update-release-process
51+
4852 build :
4953 name : " Build Gems"
54+ needs : check
55+ environment : release
5056 runs-on : ubuntu-latest
5157 strategy :
5258 fail-fast : false
5359 matrix :
54- ruby : [ '3.2', jruby ]
60+ ruby : [ 'ruby- 3.2', ' jruby-9.4' ]
5561 steps :
56- - name : Check out the repository
57- uses : actions/checkout@v4
58-
59- - name : Setup Ruby
60- uses : ruby/setup-ruby@v1
61- with :
62- ruby-version : ${{ matrix.ruby }}
63- bundler-cache : true
64-
65- - name : Set output gem file name
66- shell : bash
67- run : |
68- echo "GEM_FILE_NAME=$(bundle exec rake gem_file_name)" >> "$GITHUB_ENV"
69-
70- - name : Build the gem
71- shell : bash
72- run : bundle exec rake build
73-
74- - name : Save the generated gem file for later
75- uses : actions/upload-artifact@v4
62+ - name : " Run the build action"
63+ uses : jamis/drivers-github-tools/ruby/build@ruby-3643-update-release-process
7664 with :
77- name : ${{ env.GEM_FILE_NAME }}
78- path : ${{ env.GEM_FILE_NAME }}
79- retention-days : 1
80- overwrite : true
65+ app_id : ${{ vars.APP_ID }}
66+ app_private_key : ${{ secrets.APP_PRIVATE_KEY }}
67+ artifact : ${{ matrix.ruby }}
68+ gem_name : ${{ env.GEM_NAME }}
69+ ruby_version : ${{ matrix.ruby }}
70+ ref : ${{ needs.check.outputs.ref }}
8171
8272 publish :
8373 name : Publish Gems
84- needs : build
74+ needs : [ check, build ]
8575 environment : release
8676 runs-on : ubuntu-latest
8777 steps :
88- - name : Check out the repository
89- uses : mongodb-labs /drivers-github-tools/secure-checkout@v2
78+ - name : " Run the publish action "
79+ uses : jamis /drivers-github-tools/ruby/publish@ruby-3643-update-release-process
9080 with :
9181 app_id : ${{ vars.APP_ID }}
92- private_key : ${{ secrets.APP_PRIVATE_KEY }}
93-
94- - name : Setup Ruby
95- uses : ruby/setup-ruby@v1
96- with :
97- ruby-version : ' 3.2'
98- bundler-cache : true
99-
100- - name : Get the release version
101- shell : bash
102- run : echo "RELEASE_VERSION=$(bundle exec rake version)" >> "$GITHUB_ENV"
103-
104- - name : Setup GitHub tooling for DBX Drivers
105- uses : mongodb-labs/drivers-github-tools/setup@v2
106- with :
82+ app_private_key : ${{ secrets.APP_PRIVATE_KEY }}
10783 aws_role_arn : ${{ secrets.AWS_ROLE_ARN }}
10884 aws_region_name : ${{ vars.AWS_REGION_NAME }}
10985 aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
110-
111- - name : Fetch the gem artifacts
112- uses : actions/download-artifact@v4
113- with :
114- merge-multiple : true
115-
116- - name : Sign the gems
117- uses : mongodb-labs/drivers-github-tools/gpg-sign@v2
118- with :
119- filenames : ' *.gem'
120-
121- - name : Generate SSDLC Reports
122- uses : mongodb-labs/drivers-github-tools/full-report@v2
123- with :
124- product_name : BSON for Ruby
125- release_version : ${{ env.RELEASE_VERSION }}
126- dist_filenames : ' *.gem'
127- silk_asset_group : bson-ruby
128-
129- - name : Create the tag
130- uses : mongodb-labs/drivers-github-tools/tag-version@v2
131- with :
132- version : ${{ env.RELEASE_VERSION }}
133- tag_template : " v${VERSION}"
134- tag_message_template : " Release tag for v${VERSION}"
135-
136- - name : Create a new release
137- shell : bash
138- run : gh release create v${{ env.RELEASE_VERSION }} --title ${{ env.RELEASE_VERSION }} --generate-notes --draft
139-
140- - name : Capture the changelog
141- shell : bash
142- run : gh release view v${{ env.RELEASE_VERSION }} --json body --template '{{ .body }}' >> changelog
143-
144- - name : Prepare release message
145- shell : bash
146- run : |
147- echo "${{ format(env.RELEASE_MESSAGE_TEMPLATE, env.RELEASE_VERSION) }}" > release-message
148- cat changelog >> release-message
149-
150- - name : Update release information
151- shell : bash
152- run : |
153- echo "RELEASE_URL=$(gh release edit v${{ env.RELEASE_VERSION }} --notes-file release-message)" >> "$GITHUB_ENV"
154-
155- - name : Upload release artifacts
156- shell : bash
157- run : gh release upload v${{ env.RELEASE_VERSION }} *.gem ${{ env.RELEASE_ASSETS }}/*.sig
158-
159- - name : Upload S3 assets
160- uses : mongodb-labs/drivers-github-tools/upload-s3-assets@v2
161- with :
162- version : ${{ env.RELEASE_VERSION }}
163- product_name : ' bson-ruby'
164- dry_run : ${{ inputs.dry_run }}
165-
166- - name : Publish the gems
167- uses : rubygems/release-gem@v1
168- if : inputs.dry_run == false
169- with :
170- await-release : false
86+ dry_run : false
87+ gem_name : ${{ env.GEM_NAME }}
88+ product_name : ${{ env.PRODUCT_NAME }}
89+ product_id : ${{ env.PRODUCT_ID }}
90+ release_message : ${{ needs.check.outputs.message }}
91+ silk_asset_group : ${{ env.SILK_ASSET_GROUP }}
92+ ref : ${{ needs.check.outputs.ref }}
0 commit comments