-
Notifications
You must be signed in to change notification settings - Fork 19
53 lines (48 loc) · 1.39 KB
/
gem_push.yml
File metadata and controls
53 lines (48 loc) · 1.39 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
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Push gem to RubyGems
on:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
push:
if: github.repository == 'httprb/form_data'
runs-on: ubuntu-latest
environment:
name: rubygems.org
url: https://rubygems.org/gems/http-form_data
permissions:
contents: write
id-token: write
env:
BUNDLE_WITHOUT: sig
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
bundler-cache: true
- uses: rubygems/configure-rubygems-credentials@v1.0.0
- name: Update RubyGems
run: gem update --system
- name: Build gem
run: gem build http-form_data.gemspec
- name: Sign gem with Sigstore
run: |
for gem in http-form_data-*.gem; do
gem exec sigstore-cli sign "$gem" --bundle "${gem%.gem}.gem.sigstore.json"
done
- name: Push gem
run: |
for gem in http-form_data-*.gem; do
gem push "$gem" --attestation "${gem%.gem}.gem.sigstore.json"
done
- name: Wait for release
run: gem exec rubygems-await http-form_data-*.gem
- name: Create GitHub release
run: |
tag_name="$(git describe --tags --abbrev=0)"
gh release create "${tag_name}" --verify-tag --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}