Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup CI for publish #263

Merged
merged 5 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading