-
Notifications
You must be signed in to change notification settings - Fork 65
54 lines (45 loc) · 1.68 KB
/
Copy pathrelease.yml
File metadata and controls
54 lines (45 loc) · 1.68 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
name: Ruby Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Verify tag matches gemspec version
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
GEMSPEC_VERSION=$(ruby -e "puts Gem::Specification.load('chargebee.gemspec').version")
echo "Tag version: $TAG_VERSION"
echo "Gemspec version: $GEMSPEC_VERSION"
if [ "$TAG_VERSION" != "$GEMSPEC_VERSION" ]; then
echo "❌ Tag version ($TAG_VERSION) does not match gemspec version ($GEMSPEC_VERSION)"
exit 1
fi
echo "✅ Tag matches gemspec version."
- name: Verify gem manifest is up to date
run: |
make update-manifest
if ! git diff --quiet -- chargebee.gemspec; then
echo "❌ Gem manifest in chargebee.gemspec is out of date."
echo "Some files tracked in the repo are missing from (or stale in) s.files,"
echo "which means they would not be packaged into the released gem."
echo "Run 'make update-manifest' locally and commit the updated chargebee.gemspec."
echo "----- diff -----"
git --no-pager diff -- chargebee.gemspec
exit 1
fi
echo "✅ Gem manifest is up to date."
- name: Build gem
run: gem build chargebee.gemspec
- name: Push gem to RubyGems
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
run: gem push chargebee-*.gem