From 6083107e239195de991637dd17aba307369beb65 Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Fri, 13 Sep 2024 17:07:34 +0400 Subject: [PATCH 1/5] setup CI for publish --- .github/workflows/publish.yml | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..80f3c73 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,44 @@ +name: publish + +env: + NPM_REGISTRY: 'https://registry.npmjs.org' + +on: + push: + tags: + - v* + +jobs: + publish-to-npm: + name: "Publish new version to NPM" + runs-on: ubuntu-latest + timeout-minutes: 5 + defaults: + run: + working-directory: ./packages/libsql-client + env: + NODE_OPTIONS: "--trace-warnings" +# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + steps: + - name: "Checkout this repo" + uses: actions/checkout@v3 + + - name: "Setup Node.js" + uses: actions/setup-node@v3 + with: + node-version: "18.x" + + - name: "Build core" + run: "npm ci && npm run build" + working-directory: ./packages/libsql-core + + - name: "Install npm dependencies" + run: "npm ci" + + - name: "Publish pre-release version" + if: contains(github.ref, '-pre') + run: "npm publish --tag next" + + - name: "Publish latest version" + if: "!contains(github.ref, '-pre')" + run: "npm publish" From 3d1f5081dcb9cb6a4ae92f7e59177ff9fd495fa9 Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Fri, 13 Sep 2024 17:26:31 +0400 Subject: [PATCH 2/5] what if this will work :thinking-face: --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 80f3c73..e13ae10 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,7 +18,7 @@ jobs: working-directory: ./packages/libsql-client env: NODE_OPTIONS: "--trace-warnings" -# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} steps: - name: "Checkout this repo" uses: actions/checkout@v3 From 7eccd788bda0189d16579fc5a81c3b04590647ef Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Thu, 19 Sep 2024 10:44:53 +0400 Subject: [PATCH 3/5] rename env var --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e13ae10..c4c2573 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,7 +18,7 @@ jobs: working-directory: ./packages/libsql-client env: NODE_OPTIONS: "--trace-warnings" - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} steps: - name: "Checkout this repo" uses: actions/checkout@v3 From c6ce1f08ebea06a027ab387b2afae430d20a92d5 Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Thu, 19 Sep 2024 10:47:18 +0400 Subject: [PATCH 4/5] set 0.12.1-pre.1 verison --- package-lock.json | 10 +++++----- packages/libsql-client-wasm/package.json | 4 ++-- packages/libsql-client/package.json | 4 ++-- packages/libsql-core/package.json | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 61441df..9146aba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4716,10 +4716,10 @@ }, "packages/libsql-client": { "name": "@libsql/client", - "version": "0.12.0", + "version": "0.12.1-pre.1", "license": "MIT", "dependencies": { - "@libsql/core": "^0.12.0", + "@libsql/core": "^0.12.1-pre.1", "@libsql/hrana-client": "^0.7.0", "js-base64": "^3.7.5", "libsql": "^0.4.4", @@ -4740,13 +4740,13 @@ }, "packages/libsql-client-wasm": { "name": "@libsql/client-wasm", - "version": "0.12.0", + "version": "0.12.1-pre.1", "bundleDependencies": [ "@libsql/libsql-wasm-experimental" ], "license": "MIT", "dependencies": { - "@libsql/core": "^0.12.0", + "@libsql/core": "^0.12.1-pre.1", "@libsql/libsql-wasm-experimental": "^0.0.2", "js-base64": "^3.7.5" }, @@ -4760,7 +4760,7 @@ }, "packages/libsql-core": { "name": "@libsql/core", - "version": "0.12.0", + "version": "0.12.1-pre.1", "license": "MIT", "dependencies": { "js-base64": "^3.7.5" diff --git a/packages/libsql-client-wasm/package.json b/packages/libsql-client-wasm/package.json index fc2b8c8..ca2caa6 100644 --- a/packages/libsql-client-wasm/package.json +++ b/packages/libsql-client-wasm/package.json @@ -1,6 +1,6 @@ { "name": "@libsql/client-wasm", - "version": "0.12.0", + "version": "0.12.1-pre.1", "keywords": [ "libsql", "database", @@ -56,7 +56,7 @@ "typedoc": "rm -rf ./docs && typedoc" }, "dependencies": { - "@libsql/core": "^0.12.0", + "@libsql/core": "^0.12.1-pre.1", "@libsql/libsql-wasm-experimental": "^0.0.2", "js-base64": "^3.7.5" }, diff --git a/packages/libsql-client/package.json b/packages/libsql-client/package.json index b88dfe5..fcf1c4d 100644 --- a/packages/libsql-client/package.json +++ b/packages/libsql-client/package.json @@ -1,6 +1,6 @@ { "name": "@libsql/client", - "version": "0.12.0", + "version": "0.12.1-pre.1", "keywords": [ "libsql", "database", @@ -102,7 +102,7 @@ "lint-staged": "lint-staged" }, "dependencies": { - "@libsql/core": "^0.12.0", + "@libsql/core": "^0.12.1-pre.1", "@libsql/hrana-client": "^0.7.0", "js-base64": "^3.7.5", "libsql": "^0.4.4", diff --git a/packages/libsql-core/package.json b/packages/libsql-core/package.json index 35de22c..c650178 100644 --- a/packages/libsql-core/package.json +++ b/packages/libsql-core/package.json @@ -1,6 +1,6 @@ { "name": "@libsql/core", - "version": "0.12.0", + "version": "0.12.1-pre.1", "keywords": [ "libsql", "database", From 14e960669e691d8f6fdeed4fa9dec2d9f5f9f0a7 Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Thu, 19 Sep 2024 10:52:11 +0400 Subject: [PATCH 5/5] add .npmrc --- .npmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..ae64359 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +//registry.npmjs.org/:_authToken=${NPM_TOKEN}