Skip to content

Commit

Permalink
Merge pull request #263 from tursodatabase/setup-ci
Browse files Browse the repository at this point in the history
setup CI for publish
  • Loading branch information
sivukhin authored Sep 19, 2024
2 parents dbeba0c + 14e9606 commit fe3d668
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 10 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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"
NPM_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"
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/libsql-client-wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@libsql/client-wasm",
"version": "0.12.0",
"version": "0.12.1-pre.1",
"keywords": [
"libsql",
"database",
Expand Down Expand Up @@ -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"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/libsql-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@libsql/client",
"version": "0.12.0",
"version": "0.12.1-pre.1",
"keywords": [
"libsql",
"database",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/libsql-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@libsql/core",
"version": "0.12.0",
"version": "0.12.1-pre.1",
"keywords": [
"libsql",
"database",
Expand Down

0 comments on commit fe3d668

Please sign in to comment.