Skip to content

Commit 750a3c8

Browse files
committed
Adding push_gem
1 parent c0112c8 commit 750a3c8

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/push_gem.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
'on':
3+
push:
4+
tags:
5+
- v*
6+
name: Push Gem
7+
jobs:
8+
push:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
id-token: write
13+
steps:
14+
- uses: rubygems/configure-rubygems-credentials@main
15+
with:
16+
role-to-assume: rg_oidc_akr_emn9ecwyfnwmjxg6vp85
17+
- uses: actions/checkout@v4
18+
with:
19+
persists-credentials: false
20+
- name: Set remote URL
21+
run: |
22+
# Attribute commits to the last committer on HEAD
23+
git config --global user.email "$(git log -1 --pretty=format:'%ae')"
24+
git config --global user.name "$(git log -1 --pretty=format:'%an')"
25+
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
26+
- name: Set up Ruby
27+
uses: ruby/setup-ruby@v1
28+
with:
29+
bundler-cache: true
30+
ruby-version: ruby
31+
- name: Release
32+
run: bundle exec rake release
33+
- name: Wait for release to propagate
34+
run: |
35+
gem install rubygems-await
36+
gem_tuple="$(ruby -rbundler/setup -rbundler -e '
37+
spec = Bundler.definition.specs.find {|s| s.name == ARGV[0] }
38+
raise "No spec for #{ARGV[0]}" unless spec
39+
print [spec.name, spec.version, spec.platform].join(":")
40+
' "enumerable-stats")"
41+
gem await "${gem_tuple}"

0 commit comments

Comments
 (0)