Skip to content

Commit

Permalink
fix(ruby): release using Trusted Publishing (#2504)
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp authored Jan 9, 2024
1 parent bbe438f commit b4ca093
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Release

# This file is registered in https://rubygems.org/gems/algolia/trusted_publishers to be able to publish new versions of the gem.

on:
push:
branches:
Expand All @@ -12,6 +14,7 @@ jobs:
if: "startsWith(github.event.head_commit.message, 'chore: release')"
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4

Expand All @@ -21,8 +24,4 @@ jobs:
ruby-version: 3.2.2
bundler-cache: true

- name: Build gem
run: gem build algolia.gemspec

- name: Publish new gem
run: gem push --key ${{ secrets.RUBYGEMS_API_KEY }} $(ls algolia-*.gem)
- uses: rubygems/release-gem@v1
3 changes: 2 additions & 1 deletion scripts/ci/codegen/spreadGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ async function spreadGeneration(): Promise<void> {
await run('git push', { cwd: tempGitDir });

// In case of a release commit, we also want to update tags on the clients repositories
if (IS_RELEASE_COMMIT) {
// ruby tag is already pushed by `rake release`
if (IS_RELEASE_COMMIT && lang !== 'ruby') {
// Go needs a 'v' prefix for tags.
const tagVersion = lang === 'go' ? `v${version}` : version;

Expand Down

0 comments on commit b4ca093

Please sign in to comment.