From e341cc1fc6e4c792dec85a2e61c76a196133d883 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 15 Feb 2024 07:17:05 +0000 Subject: [PATCH] chore: go live --- .github/workflows/publish-npm.yml | 32 +++++++++++++ .github/workflows/release-doctor.yml | 19 ++++++++ .release-please-manifest.json | 3 ++ bin/check-release-environment | 21 +++++++++ bin/check-test-server | 0 build | 0 release-please-config.json | 70 ++++++++++++++++++++++++++++ scripts/check-is-in-git-install.sh | 0 src/version.ts | 2 +- 9 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-npm.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .release-please-manifest.json create mode 100644 bin/check-release-environment mode change 100644 => 100755 bin/check-test-server mode change 100644 => 100755 build create mode 100644 release-please-config.json mode change 100644 => 100755 scripts/check-is-in-git-install.sh diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..80d3c5e --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,32 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to NPM in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/groq/groq-node/actions/workflows/publish-npm.yml +name: Publish NPM +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: | + yarn install + + - name: Publish to NPM + run: | + bash ./bin/publish-npm + env: + NPM_TOKEN: ${{ secrets.GROQ_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..a2b2bd7 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,19 @@ +name: Release Doctor +on: + pull_request: + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'groq/groq-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v3 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + NPM_TOKEN: ${{ secrets.GROQ_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..466df71 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..096d87a --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${NPM_TOKEN}" ]; then + errors+=("The GROQ_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +len=${#errors[@]} + +if [[ len -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/bin/check-test-server b/bin/check-test-server old mode 100644 new mode 100755 diff --git a/build b/build old mode 100644 new mode 100755 diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..3842dbf --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,70 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "reviewers": [ + "gradenr" + ], + "release-type": "node", + "extra-files": [ + "src/version.ts", + "README.md" + ] +} diff --git a/scripts/check-is-in-git-install.sh b/scripts/check-is-in-git-install.sh old mode 100644 new mode 100755 diff --git a/src/version.ts b/src/version.ts index 37025ab..1baa228 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.1.0'; +export const VERSION = '0.1.0'; // x-release-please-version