Skip to content

Commit 101defe

Browse files
Add RubyGems publish workflow (#140)
1 parent 507f6c0 commit 101defe

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish to RubyGems
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
12+
jobs:
13+
publish:
14+
name: Build and publish
15+
runs-on: ubuntu-latest
16+
environment: rubygems
17+
18+
steps:
19+
- uses: actions/checkout@v6
20+
with:
21+
persist-credentials: false
22+
23+
- name: Set up Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: "3.4"
27+
bundler-cache: true
28+
29+
- name: Verify tag matches gem version
30+
run: |
31+
tag="${GITHUB_REF#refs/tags/v}"
32+
version=$(ruby -r ./lib/customerio/version -e "puts Customerio::VERSION")
33+
if [ "$tag" != "$version" ]; then
34+
echo "::error::Tag v$tag does not match Customerio::VERSION ($version)"
35+
exit 1
36+
fi
37+
38+
- name: Publish to RubyGems
39+
uses: rubygems/release-gem@v1

0 commit comments

Comments
 (0)