Release JS SDK #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release JS SDK | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to publish (e.g., 0.3.0 | 0.3.0-beta)' | |
required: true | |
type: string | |
isRCRelease: | |
description: 'Is this a release candidate release?' | |
required: true | |
type: boolean | |
jobs: | |
run-js-tests: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: js | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: npm install -g pnpm | |
- name: Install packages in js folder | |
run: pnpm install --frozen-lockfile | |
- name: Set publishing config | |
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: Update version | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Composio" | |
npm version ${{ github.event.inputs.version }} --no-git-tag-version | |
- name: Commit and push | |
run: | | |
if git diff --quiet; then | |
echo "No changes to commit" | |
else | |
git commit -am "Release ${{ github.event.inputs.version }}" && git push | |
fi | |
- name: pnpm build | |
run: pnpm build | |
- name: pnpm publish | |
run: | | |
if ${{ github.event.inputs.isRCRelease }}; then | |
pnpm publish --no-git-checks --tag rc | |
else | |
pnpm publish --no-git-checks | |
fi |