2727jobs :
2828 validate :
2929 # Generic except where marked LANGUAGE-SPECIFIC
30- runs-on : ubuntu-latest
30+ runs-on : ubuntu-24.04
3131 timeout-minutes : 10
3232 permissions :
3333 contents : read
4444 fetch-depth : 0
4545
4646 # LANGUAGE-SPECIFIC: replace with your language's setup action
47- - uses : ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
47+ - name : Set up language runtime
48+ uses : ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
4849 with :
4950 ruby-version : ' 3.4'
5051 bundler-cache : true
9091
9192 prepare :
9293 needs : validate
93- runs-on : ubuntu-latest
94+ runs-on : ubuntu-24.04
9495 timeout-minutes : 5
9596 permissions :
9697 contents : write # required for releases/generate-notes API
@@ -128,7 +129,7 @@ jobs:
128129
129130 notify :
130131 needs : [validate, prepare]
131- runs-on : ubuntu-latest
132+ runs-on : ubuntu-24.04
132133 timeout-minutes : 5
133134 permissions :
134135 contents : read
@@ -215,11 +216,12 @@ jobs:
215216 curl -s -X POST "https://slack.com/api/chat.postMessage" \
216217 -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
217218 -H "Content-Type: application/json; charset=utf-8" \
218- -d "{\"channel\": \"$SLACK_CHANNEL\", \"text\": \"$TEXT\"}"
219+ -d "$(jq -n --arg channel "$SLACK_CHANNEL" --arg text "$TEXT" \
220+ '{channel: $channel, text: $text}')"
219221
220222 publish :
221223 needs : [validate, prepare, notify]
222- runs-on : ubuntu-latest
224+ runs-on : ubuntu-24.04
223225 timeout-minutes : 15
224226 environment : ${{ inputs.dry_run && 'rubygems-publish-dry-run' || 'rubygems-publish' }}
225227
@@ -234,32 +236,44 @@ jobs:
234236 fetch-depth : 0
235237
236238 # LANGUAGE-SPECIFIC: replace with your language's setup action
237- - uses : ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
239+ - name : Set up language runtime
240+ uses : ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
238241 with :
239242 ruby-version : ' 3.4'
240243 bundler-cache : true
241244
242- - name : Create release tag
243- if : ${{ !inputs.dry_run }}
244- run : git tag "$GITHUB_REF_NAME"
245+ # LANGUAGE-SPECIFIC: replace with your language's publish command.
246+ # Runs `bundle exec rake release` which: lints, builds, pushes gem to
247+ # RubyGems with SLSA attestation, and pushes the git tag to GitHub.
248+ # In dry run, gem push and tag push are skipped via DRY_RUN env var
249+ # in the Rakefile — rubygems/release-gem itself has no dry run mode.
250+ # await-release is disabled in dry run since no gem is pushed.
251+ - name : Publish package with attestation
252+ uses : rubygems/release-gem@6317d8d1f7e28c24d28f6eff169ea854948bd9f7 # v1.2.0
253+ with :
254+ await-release : ${{ inputs.dry_run && 'false' || 'true' }}
245255 env :
246- GITHUB_REF_NAME : ${{ needs.validate.outputs.release_tag }}
256+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
257+ DRY_RUN : ${{ inputs.dry_run }}
247258
248- # LANGUAGE-SPECIFIC: replace with your language's publish command
249- - name : Publish package with attestation
259+ - name : Create GitHub release
250260 if : ${{ !inputs.dry_run }}
251- uses : rubygems/release-gem@6317d8d1f7e28c24d28f6eff169ea854948bd9f7 # v1.2.0
252261 env :
253262 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
254- GITHUB_REF_NAME : ${{ needs.validate.outputs.release_tag }}
263+ TAG : ${{ needs.validate.outputs.release_tag }}
264+ run : |
265+ echo "${{ needs.prepare.outputs.notes }}" | base64 -d 2>/dev/null > /tmp/release-notes.md
266+ gh release create "$TAG" \
267+ --title "$TAG" \
268+ --notes-file /tmp/release-notes.md \
269+ --target "${{ inputs.sha }}"
255270
256- # LANGUAGE-SPECIFIC: replace with your language's build/check command
257- - name : Dry run — build and check only
271+ - name : Release notes preview
258272 if : ${{ inputs.dry_run }}
259273 run : |
260- bundle exec rake lint
261- bundle exec rake build
262- echo "DRY RUN: would push gem ${{ needs.validate .outputs.release_tag }} to RubyGems and create tag "
274+ echo "DRY RUN: would create GitHub release ${{ needs.validate.outputs.release_tag }}"
275+ echo "--- Release notes preview ---"
276+ echo "${{ needs.prepare .outputs.notes }}" | base64 -d 2>/dev/null || echo "(unavailable) "
263277
264278 - name : Notify Slack on release
265279 env :
@@ -309,4 +323,5 @@ jobs:
309323 curl -s -X POST "https://slack.com/api/chat.postMessage" \
310324 -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
311325 -H "Content-Type: application/json; charset=utf-8" \
312- -d "{\"channel\": \"$SLACK_CHANNEL\", \"text\": \"$TEXT\"}"
326+ -d "$(jq -n --arg channel "$SLACK_CHANNEL" --arg text "$TEXT" \
327+ '{channel: $channel, text: $text}')"
0 commit comments