Skip to content

Commit 3842b94

Browse files
committed
🚀 chore: add ci/cd github actions
1 parent d34ed6a commit 3842b94

5 files changed

Lines changed: 2383 additions & 3 deletions

File tree

.github/workflows/cd.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Continuous Deployment
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
id-token: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Setup pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: 10.18.3
30+
31+
- name: Get pnpm store directory
32+
shell: bash
33+
run: |
34+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
35+
36+
- name: Setup pnpm cache
37+
uses: actions/cache@v4
38+
with:
39+
path: ${{ env.STORE_PATH }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
43+
44+
- name: Install dependencies
45+
run: pnpm install --frozen-lockfile
46+
47+
- name: Publish to npm
48+
run: pnpm publish:package
49+
env:
50+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/ci.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Continuous Integration
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 10.18.3
25+
26+
- name: Get pnpm store directory
27+
shell: bash
28+
run: |
29+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
30+
31+
- name: Setup pnpm cache
32+
uses: actions/cache@v4
33+
with:
34+
path: ${{ env.STORE_PATH }}
35+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
36+
restore-keys: |
37+
${{ runner.os }}-pnpm-store-
38+
39+
- name: Install dependencies
40+
run: pnpm install --frozen-lockfile
41+
42+
- name: Run checks
43+
run: pnpm check
44+
45+
- name: Build packages
46+
run: pnpm build

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
node_modules/
33
package-lock.json
44
yarn.lock
5-
pnpm-lock.yaml
65

76
# Build output
87
dist/

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@haroonwaves/sqlite-wasm-easy",
3-
"version": "0.0.1",
3+
"version": "0.1.3",
44
"description": "A simple, zero-config wrapper around @sqlite.org/sqlite-wasm",
55
"type": "module",
66
"main": "./dist/index.js",
@@ -32,7 +32,11 @@
3232
"spellcheck": "cspell \"**/*\"",
3333
"typecheck": "tsc --noEmit",
3434
"check": "npm run lint && npm run spellcheck && npm run typecheck && npm run format:check",
35-
"prepublishOnly": "npm run build"
35+
"prepublishOnly": "npm run build",
36+
"publish:package": "pnpm publish --access public --no-git-checks"
37+
},
38+
"publishConfig": {
39+
"access": "public"
3640
},
3741
"keywords": [
3842
"sqlite",

0 commit comments

Comments
 (0)