From 62676765bec81e373b3bfea691e6ad2f672dfbc7 Mon Sep 17 00:00:00 2001 From: Evan Tahler Date: Tue, 1 Apr 2025 20:15:19 -0700 Subject: [PATCH 1/3] NPM publishing and Monorepo --- .github/workflows/publish.yml | 28 ++ README.md | 19 ++ demo/index.html | 2 +- demo/package.json | 3 + package.json | 9 +- pnpm-lock.yaml | 581 ++++++++++++++++++++++++++++++++++ pnpm-workspace.yaml | 3 + scripts/publish.sh | 16 + 8 files changed, 658 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 pnpm-workspace.yaml create mode 100755 scripts/publish.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..61f0b3f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish Widget +on: + push: + branches: [main] + paths: ["widget/**"] + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + registry-url: "https://registry.npmjs.org" + - name: Install PNPM + run: npm install -g pnpm + - name: Install dependencies + run: pnpm install + - name: Publish + working-directory: widget + run: ./scripts/publish.sh + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 107cdc7..5617119 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,25 @@ To configure the demo, create a `.env` file in the `/demo` directory: VITE_API_TOKEN=your_api_token_here ``` +## Publishing + +This repository is configured to publish to npmjs.org whenever: + +1. There is an update to the main branch. +2. A new version is created in the `package.json`. + +To create a new version, you can use the following command: + +```bash +pnpm version +``` + +and then push those changes to the main branch. Don't forget the tags! + +```bash +git push origin main --tags && git push +``` + ## License This software is proprietary and confidential. Commercial terms apply. Please see [LICENSE.txt](LICENSE.txt) for details or contact Airbyte, Inc. for licensing information. diff --git a/demo/index.html b/demo/index.html index 8707902..89107bf 100644 --- a/demo/index.html +++ b/demo/index.html @@ -26,7 +26,7 @@

Airbyte Widget Demo