-
Notifications
You must be signed in to change notification settings - Fork 1.3k
40 lines (33 loc) · 1.66 KB
/
gems-release-to-rubygems.yml
File metadata and controls
40 lines (33 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Gems - Release to RubyGems
on: # yamllint disable-line rule:truthy
release:
# It's fine to trigger on every release because if we tag a release w/o
# bumping the Gem version, RubyGems will reject it with an error that the
# version is already live.
types: [published]
jobs:
release-gems:
name: Release gems to rubygems.org
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0
with:
bundler-cache: true
- name: Install the RubyGems version specified in the Dockerfile.updater-core file
run: |
RUBYGEMS_VERSION=$(grep 'ARG RUBYGEMS_VERSION=' Dockerfile.updater-core | cut -d '=' -f 2)
gem update --system $RUBYGEMS_VERSION
- name: Install sorbet-runtime for typed code support
run: |
SORBET_RUNTIME_VERSION=$(grep 'sorbet-runtime (' Gemfile.lock | grep -v '~>' | grep -v '=' | head -n 1 | sed 's/.*(\(.*\))/\1/')
gem install sorbet-runtime -v $SORBET_RUNTIME_VERSION
- uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
# We can't use the https://github.com/rubygems/release-gem workflow because it calls `rake release` rather than `rake gems:release`.
# `rake release` causes problems because it tries to push a git tag, but we've already manually tagged the release as part of the `gems-bump-version` workflow.
- run: gem exec rake gems:release