-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
44 lines (44 loc) · 1.58 KB
/
action.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
40
41
42
43
44
name: "Release Gem"
description: "Upload gems to RubyGems.org"
inputs:
await-release:
description: "Whether to poll for the release to be available on RubyGems.org"
required: false
default: "true"
setup-trusted-publisher:
description: "Whether to setup the trusted publisher for the gem"
required: false
default: "true"
attestations:
description: >-
[EXPERIMENTAL]
Enable experimental support for sigstore attestations.
Only works with RubyGems.org via Trusted Publishing.
required: false
default: "true"
outputs: {}
branding:
color: "red"
icon: "upload-cloud"
runs:
using: "composite"
steps:
- 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:${{ github.token }}@github.com/$GITHUB_REPOSITORY"
shell: bash
- name: Configure trusted publishing credentials
if: ${{ inputs.setup-trusted-publisher == 'true' }}
uses: rubygems/[email protected]
- name: Run release rake task
run: bundle exec rake release
shell: bash
env:
RUBYOPT: "${{ inputs.attestations == 'true' && format('-r{0}/rubygems-attestation-patch.rb {1}', github.action_path, env.RUBYOPT) || env.RUBYOPT }}"
- name: Wait for release to propagate
if: ${{ inputs.await-release == 'true' }}
run: gem exec rubygems-await pkg/*.gem
shell: bash