-
-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (51 loc) · 1.64 KB
/
release-please.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
45
46
47
48
49
50
51
52
53
54
55
56
on:
push:
branches:
- main
name: Run Release Please
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{secrets.RELEASE_PLEASE_TOKEN}}
release-type: ruby
package-name: sorbet-schema
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
version-file: "lib/sorbet-schema/version.rb"
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_tag_name: ${{ steps.release.outputs.tag_name }}
gem-release:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
# The logic below handles the RubyGems publication:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.release_tag_name }}
# Set up Ruby if a release can be created.
- uses: ruby/setup-ruby@v1
- run: bundle install
- 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_GEMS_PUSH_API_KEY}}"