feat: make spotlight an optional peer dep (#50) #31
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: Publish | |
on: | |
push: | |
branches: | |
- main | |
# We allow manually dispatching workflow when needed. Most often, this will not be needed. | |
workflow_dispatch: | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
publish-sdks: | |
name: Publish package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | |
uses: actions/checkout@v3 | |
with: | |
# need this custom token to run CI checks on the created PR | |
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20.10.0" | |
registry-url: "https://registry.npmjs.org" | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
with: | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Create Release PR & Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm ci:release | |
title: "📦 Publish Package" | |
commit: "📦 Publish Package" | |
env: | |
# need this custom token to run CI checks on the created PR | |
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | |
# probably don't need both of those, but it works! | |
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} |