Skip to content

Commit 2663973

Browse files
committed
chore: ci/cd
1 parent 98041a6 commit 2663973

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
permissions:
13+
id-token: write
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Ruby
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: "3.3"
22+
bundler-cache: true
23+
24+
- name: Verify tag matches Infisical::VERSION
25+
run: |
26+
TAG_VERSION="${GITHUB_REF_NAME#v}"
27+
GEM_VERSION="$(ruby -r ./lib/infisical/version -e 'puts Infisical::VERSION')"
28+
if [ "$TAG_VERSION" != "$GEM_VERSION" ]; then
29+
echo "::error::Tag ${GITHUB_REF_NAME} does not match Infisical::VERSION (${GEM_VERSION})."
30+
echo "::error::Bump lib/infisical/version.rb on main, then re-tag."
31+
exit 1
32+
fi
33+
34+
- name: Run tests
35+
run: bundle exec rspec
36+
37+
- name: Run rubocop
38+
run: bundle exec rubocop
39+
40+
- name: Configure RubyGems credentials (trusted publishing)
41+
uses: rubygems/configure-rubygems-credentials@v1
42+
43+
- name: Build gem
44+
run: gem build infisical-sdk.gemspec
45+
46+
- name: Push to RubyGems
47+
run: gem push "infisical-sdk-${GITHUB_REF_NAME#v}.gem"

0 commit comments

Comments
 (0)