From fc0b48f7fd340c73ad4bec0b86acda379bc3c14b Mon Sep 17 00:00:00 2001 From: bugloper Date: Tue, 16 Jul 2024 15:55:48 +0600 Subject: [PATCH] feat: automatic release using release-please --- .github/workflows/release-please.yml | 36 ++++++++++++++++++++++++++++ .release-please-manifest.json | 3 +++ release-please-config.json | 19 +++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..b58097a --- /dev/null +++ b/.github/workflows/release-please.yml @@ -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}}" diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..0ee8c01 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.3.0" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..ff49d38 --- /dev/null +++ b/release-please-config.json @@ -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" + } + } +}