Skip to content

Commit

Permalink
feat: automatic release using release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
bugloper committed Jul 16, 2024
1 parent 47a6dfc commit 7c30d25
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.3.0"
}
19 changes: 19 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"include-component-in-tag": true,
"include-v-in-tag": true,
"prerelease": false,
"skip-github-release": false,
"separate-pull-requests": true,
"tag-separator": "/",
"sequential-calls": true,
"packages": {
".": {
"release-type": "ruby",
"package-name": "groq-ruby"
}
}
}
36 changes: 36 additions & 0 deletions release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release
on:
push:
branches:
- "develop" # develop only
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: googleapis/release-please-action@v4
id: release
# Checkout code if release was created
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
# Setup ruby if a release was created
- uses: ruby/setup-ruby@v1

with:
# Not needed with a .ruby-version file
ruby-version: ruby
# runs 'bundle install' and caches installed gems automatically
bundler-cache: true
if: ${{ steps.release.outputs.release_created }}

- name: Publish to RubyGems
if: ${{ steps.release.outputs.release_created }}
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"

0 comments on commit 7c30d25

Please sign in to comment.