-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (58 loc) · 1.9 KB
/
Copy pathrelease-please.yml
File metadata and controls
64 lines (58 loc) · 1.9 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
54
55
56
57
58
59
60
61
62
63
64
name: Release Please
on:
push:
branches:
- main
jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
# Release-please creates a PR that tracks all changes
steps:
- uses: googleapis/release-please-action@v5
id: release
with:
release-type: ruby
command: manifest
token: ${{ secrets.RELEASE_PLEASE_ACTION_TOKEN }}
default-branch: main
signoff: "OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>"
outputs:
all: ${{ toJSON(steps.release.outputs) }}
paths_released: ${{ steps.release.outputs.paths_released }}
publish-gems:
name: Publish Ruby Gems
needs: release-please
runs-on: ubuntu-latest
if: ${{ fromJSON(needs.release-please.outputs.paths_released)[0] != null }}
strategy:
matrix:
path: ${{ fromJSON(needs.release-please.outputs.paths_released) }}
env:
TAG: ${{ fromJSON(needs.release-please.outputs.all)[format('{0}--tag_name', matrix.path)] }}
defaults:
run:
working-directory: ./${{ matrix.path }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ env.TAG }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 4.0.6
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Release Gem
run: |
gem install bundler
bundle config unset deployment
bundle install
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBY_GEM_API_TOKEN}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
RUBY_GEM_API_TOKEN: "${{secrets.RUBY_GEM_API_TOKEN}}"