-
-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (39 loc) · 1.31 KB
/
push_gem.yml
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
---
"on":
push:
tags:
- v*
name: Push Gem
jobs:
push:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: rubygems/configure-rubygems-credentials@main
with:
role-to-assume: rg_oidc_akr_e3gvf8d8qwrffk7gjno7
- uses: actions/checkout@v4
- name: Set remote URL
run: |
# Attribute commits to the last committer on HEAD
git config --global user.email "$(git log -1 --pretty=format:'%ae')"
git config --global user.name "$(git log -1 --pretty=format:'%an')"
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby
- name: Release
run: bundle exec rake release
- name: Wait for release to propagate
run: |
gem install rubygems-await
gem_tuple="$(ruby -rbundler/setup -rbundler -e '
spec = Bundler.definition.specs.find {|s| s.name == ARGV[0] }
raise "No spec for #{ARGV[0]}" unless spec
print [spec.name, spec.version, spec.platform].join(":")
' "rubygems-generate_index")"
gem await "${gem_tuple}"