diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..7ddce00 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,40 @@ +--- +name: Publish to npm + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Read .nvmrc + run: echo "GITHUB_NVMRC_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV + + - name: Set up Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: ${{ env.GITHUB_NVMRC_VERSION }} + registry-url: "https://registry.npmjs.org/" + + - name: Install root dependencies + run: npm ci + + - name: Install React subpackage dependencies + run: npm ci + working-directory: src/react + + - name: Build + run: npm run build + working-directory: ./ + + - name: Publish to npm + run: npm publish --tag latest --provenance diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24