Skip to content

Commit af4df1f

Browse files
committed
initial commit
0 parents  commit af4df1f

File tree

23 files changed

+1168
-0
lines changed

23 files changed

+1168
-0
lines changed

.github/workflows/auto-publish.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Auto-publish libsql-server updates
2+
3+
on:
4+
schedule:
5+
# Run daily at 9 AM UTC
6+
- cron: '0 9 * * *'
7+
workflow_dispatch: # Allow manual triggering
8+
push:
9+
branches: [main]
10+
paths:
11+
- 'scripts/**'
12+
- '.github/workflows/**'
13+
14+
jobs:
15+
check-and-publish:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '18'
26+
registry-url: 'https://registry.npmjs.org'
27+
28+
- name: Setup Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Install dependencies
32+
run: npm install
33+
34+
- name: Check for new version
35+
id: check-version
36+
run: |
37+
if node scripts/check-version.js; then
38+
echo "new-version=true" >> $GITHUB_OUTPUT
39+
else
40+
echo "new-version=false" >> $GITHUB_OUTPUT
41+
fi
42+
continue-on-error: true
43+
44+
- name: Extract binaries
45+
if: steps.check-version.outputs.new-version == 'true'
46+
run: node scripts/extract-binaries.js
47+
48+
- name: Test binaries
49+
if: steps.check-version.outputs.new-version == 'true'
50+
run: node scripts/test.js
51+
52+
- name: Commit updated binaries
53+
if: steps.check-version.outputs.new-version == 'true'
54+
run: |
55+
git config --local user.email "[email protected]"
56+
git config --local user.name "GitHub Action"
57+
git add packages/*/sqld packages/*/package.json package.json
58+
git commit -m "Update to latest libsql-server release" || exit 0
59+
git push
60+
61+
- name: Publish to npm
62+
if: steps.check-version.outputs.new-version == 'true'
63+
run: node scripts/publish-all.js
64+
env:
65+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
66+
67+
- name: Create GitHub Release
68+
if: steps.check-version.outputs.new-version == 'true'
69+
uses: actions/create-release@v1
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
with:
73+
tag_name: ${{ steps.get-version.outputs.version }}
74+
release_name: Release ${{ steps.get-version.outputs.version }}
75+
body: |
76+
Automated release of libsql-server ${{ steps.get-version.outputs.version }}
77+
78+
This release includes platform-specific binaries for:
79+
- macOS ARM64 (@sqld/darwin-arm64)
80+
- macOS x64 (@sqld/darwin-x64)
81+
- Linux ARM64 (@sqld/linux-arm64)
82+
- Linux x64 (@sqld/linux-x64)
83+
draft: false
84+
prerelease: false

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Test Build Process
2+
3+
on:
4+
workflow_dispatch: # Manual trigger only
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
test-build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '18'
20+
21+
- name: Setup Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Install dependencies
25+
run: npm install
26+
27+
- name: Check for new version
28+
run: node scripts/check-version.js
29+
continue-on-error: true
30+
31+
- name: Extract binaries (test)
32+
run: node scripts/extract-binaries.js
33+
34+
- name: Test binaries
35+
run: node scripts/test.js
36+
37+
- name: Verify package structure
38+
run: |
39+
echo "Checking package structure..."
40+
ls -la packages/*/
41+
echo "Checking binary sizes..."
42+
du -h packages/*/sqld
43+
echo "Checking package.json versions..."
44+
cat package.json | grep version
45+
cat packages/*/package.json | grep version

.gitignore

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Runtime data
8+
pids
9+
*.pid
10+
*.seed
11+
*.pid.lock
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage/
15+
*.lcov
16+
17+
# nyc test coverage
18+
.nyc_output
19+
20+
# Grunt intermediate storage
21+
.grunt
22+
23+
# Bower dependency directory
24+
bower_components
25+
26+
# node-waf configuration
27+
.lock-wscript
28+
29+
# Compiled binary addons
30+
build/Release
31+
32+
# Dependency directories
33+
jspm_packages/
34+
35+
# TypeScript cache
36+
*.tsbuildinfo
37+
38+
# Optional npm cache directory
39+
.npm
40+
41+
# Optional eslint cache
42+
.eslintcache
43+
44+
# Microbundle cache
45+
.rpt2_cache/
46+
.rts2_cache_cjs/
47+
.rts2_cache_es/
48+
.rts2_cache_umd/
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env
61+
.env.test
62+
63+
# parcel-bundler cache
64+
.cache
65+
.parcel-cache
66+
67+
# Next.js build output
68+
.next
69+
70+
# Nuxt.js build / generate output
71+
.nuxt
72+
dist
73+
74+
# Gatsby files
75+
.cache/
76+
public
77+
78+
# Storybook build outputs
79+
.out
80+
.storybook-out
81+
82+
# Temporary folders
83+
tmp/
84+
temp/
85+
86+
# Logs
87+
logs
88+
*.log
89+
90+
# Runtime data
91+
pids
92+
*.pid
93+
*.seed
94+
95+
# Directory for instrumented libs generated by jscoverage/JSCover
96+
lib-cov
97+
98+
# Coverage directory used by tools like istanbul
99+
coverage
100+
101+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
102+
.grunt
103+
104+
# Compiled binary addons (http://nodejs.org/api/addons.html)
105+
build/Release
106+
107+
# Dependency directory
108+
# Commenting this out since it may be useful to commit the lock file
109+
# node_modules
110+
111+
# Users Environment Variables
112+
.lock-wscript
113+
114+
# IDEs and editors (shamelessly copied from @angular/cli's .gitignore)
115+
/.idea
116+
.project
117+
.classpath
118+
.c9/
119+
*.launch
120+
.settings/
121+
*.sublime-workspace
122+
123+
# IDE - VSCode
124+
.vscode/*
125+
!.vscode/settings.json
126+
!.vscode/tasks.json
127+
!.vscode/launch.json
128+
!.vscode/extensions.json
129+
130+
# misc
131+
/.sass-cache
132+
/connect.lock
133+
/coverage/*
134+
/libpeerconnection.log
135+
npm-debug.log
136+
testem.log
137+
/typings
138+
139+
# e2e
140+
/e2e/*.js
141+
/e2e/*.map
142+
143+
#System Files
144+
.DS_Store
145+
Thumbs.db
146+
147+
# Temporary files
148+
temp-sqld

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 the sqld authors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)