Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to RubyGems

on:
push:
tags:
- "v*"

permissions:
contents: write
id-token: write

jobs:
publish:
name: Build and publish
runs-on: ubuntu-latest
environment: rubygems

steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true

- name: Verify tag matches gem version
run: |
tag="${GITHUB_REF#refs/tags/v}"
version=$(ruby -r ./lib/customerio/version -e "puts Customerio::VERSION")
if [ "$tag" != "$version" ]; then
echo "::error::Tag v$tag does not match Customerio::VERSION ($version)"
exit 1
fi

- name: Publish to RubyGems
uses: rubygems/release-gem@v1