name: publish permissions: contents: read id-token: write on: push: tags: - v* jobs: publish-to-npm: name: "Publish new version to NPM" runs-on: ubuntu-latest timeout-minutes: 5 env: NODE_OPTIONS: "--trace-warnings" steps: - name: "Checkout this repo" uses: actions/checkout@v4 - name: "Setup Node.js" uses: actions/setup-node@v4 with: node-version: "20.x" - name: "Update npm" run: npm install -g npm@11 - name: "Build core" run: "npm ci && npm run build" working-directory: ./packages/libsql-core - name: "Publish core (pre-release)" if: contains(github.ref, '-pre') run: npm publish --tag next --provenance --access public working-directory: ./packages/libsql-core - name: "Publish core (latest)" if: "!contains(github.ref, '-pre')" run: npm publish --provenance --access public working-directory: ./packages/libsql-core - name: "Install npm dependencies (client)" run: "npm ci" working-directory: ./packages/libsql-client - name: "Publish client (pre-release)" if: contains(github.ref, '-pre') run: npm publish --tag next --provenance --access public working-directory: ./packages/libsql-client - name: "Publish client (latest)" if: "!contains(github.ref, '-pre')" run: npm publish --provenance --access public working-directory: ./packages/libsql-client - name: "Install npm dependencies (client wasm)" run: "npm ci" working-directory: ./packages/libsql-client-wasm - name: "Publish client-wasm (pre-release)" if: contains(github.ref, '-pre') run: npm publish --tag next --provenance --access public working-directory: ./packages/libsql-client-wasm - name: "Publish client-wasm (latest)" if: "!contains(github.ref, '-pre')" run: npm publish --provenance --access public working-directory: ./packages/libsql-client-wasm