Skip to content

Commit 1817ac8

Browse files
authored
ci: split release please check from gem publish (#259)
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
1 parent d872d50 commit 1817ac8

2 files changed

Lines changed: 36 additions & 32 deletions

File tree

.github/workflows/gem-release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
on:
2+
release:
3+
types: [published]
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Release tag to publish (e.g. v0.6.5)"
8+
required: true
9+
type: string
10+
11+
name: Publish Gem
12+
permissions:
13+
contents: read
14+
jobs:
15+
gem-release:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
20+
with:
21+
ref: ${{ github.event.release.tag_name || inputs.tag }}
22+
23+
- uses: ruby/setup-ruby@v1
24+
- run: bundle install
25+
26+
- name: Release Gem
27+
run: |
28+
bundle config unset deployment
29+
mkdir -p $HOME/.gem
30+
touch $HOME/.gem/credentials
31+
chmod 0600 $HOME/.gem/credentials
32+
printf -- "---\n:rubygems_api_key: ${RUBY_GEM_API_TOKEN}\n" > $HOME/.gem/credentials
33+
gem build *.gemspec
34+
gem push *.gem
35+
env:
36+
RUBY_GEM_API_TOKEN: "${{secrets.RUBY_GEM_API_TOKEN}}"

.github/workflows/release-please.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,3 @@ jobs:
1717
token: ${{ secrets.RELEASE_PLEASE_ACTION_TOKEN }}
1818
config-file: release-please-config.json
1919
manifest-file: .release-please-manifest.json
20-
outputs:
21-
release_created: ${{ steps.release.outputs.release_created }}
22-
release_tag_name: ${{ steps.release.outputs.tag_name }}
23-
24-
gem-release:
25-
needs: release-please
26-
runs-on: ubuntu-latest
27-
if: ${{ needs.release-please.outputs.release_created }}
28-
steps:
29-
# The logic below handles the npm publication:
30-
- name: Checkout Repository
31-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
32-
with:
33-
ref: ${{ needs.release-please.outputs.release_tag_name }}
34-
35-
# Set up Ruby if a release can be created.
36-
- uses: ruby/setup-ruby@v1
37-
- run: bundle install
38-
39-
- name: Release Gem
40-
run: |
41-
gem install bundler
42-
bundle config unset deployment
43-
bundle install
44-
mkdir -p $HOME/.gem
45-
touch $HOME/.gem/credentials
46-
chmod 0600 $HOME/.gem/credentials
47-
printf -- "---\n:rubygems_api_key: ${RUBY_GEM_API_TOKEN}\n" > $HOME/.gem/credentials
48-
gem build *.gemspec
49-
gem push *.gem
50-
env:
51-
RUBY_GEM_API_TOKEN: "${{secrets.RUBY_GEM_API_TOKEN}}"

0 commit comments

Comments
 (0)