Skip to content

Commit 26984da

Browse files
committed
tmp
1 parent e50975a commit 26984da

17 files changed

Lines changed: 2648 additions & 1930 deletions

.github/workflows/autoupdate.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Autoupdate
2+
on:
3+
schedule:
4+
- cron: "0 1 * * *"
5+
concurrency:
6+
group: "${{ github.workflow }} @ ${{ github.ref }}"
7+
cancel-in-progress: false
8+
jobs:
9+
update:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
outputs:
13+
updated: ${{ steps.autoupdate.outputs.updated }}
14+
version: ${{ steps.autoupdate.outputs.version }}
15+
steps:
16+
- name: Checkout repo
17+
id: checkout_repo
18+
uses: actions/checkout@v5
19+
with:
20+
path: "tmp"
21+
ref: "main"
22+
- name: Autoupdate
23+
id: autoupdate
24+
uses: siarheidudko/autoupdater@v6
25+
with:
26+
author-email: "slavianich@gmail.com"
27+
author-name: "Siarhei Dudko"
28+
working-directory: ${{ github.workspace }}/tmp
29+
ref: ${{ github.repository }}
30+
branch: "main"
31+
builds-and-checks: |
32+
npm run lint
33+
npm run build
34+
npm run test:ts
35+
debug: "true"
36+
ignore-packages: |
37+
@types/node
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Build and deploy
2+
on:
3+
push:
4+
tags:
5+
- "*.*.*"
6+
- "v*.*.*"
7+
permissions:
8+
id-token: write
9+
contents: read
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
env:
15+
NODE_VERSION: 22
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v5
19+
- name: Use Node.js ${{ env.NODE_VERSION }}
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version: ${{ env.NODE_VERSION }}
23+
- name: Cache node modules
24+
uses: actions/cache@v4
25+
env:
26+
cache-name: cache-node-modules
27+
with:
28+
path: ~/.npm
29+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
30+
restore-keys: |
31+
${{ runner.os }}-build-${{ env.cache-name }}-
32+
${{ runner.os }}-build-
33+
${{ runner.os }}-
34+
- name: Install dependencies
35+
run: npm ci
36+
- name: Install builder
37+
run: sudo npm install typescript tslint -g
38+
- name: Run linter
39+
run: npm run lint
40+
- name: Run builder
41+
run: npm run build
42+
- name: Archiving dist directory
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: dist
46+
path: ${{ github.workspace }}/dist
47+
test:
48+
runs-on: ubuntu-latest
49+
timeout-minutes: 15
50+
needs: build
51+
strategy:
52+
matrix:
53+
node-version: [20, 22]
54+
steps:
55+
- name: Checkout repo
56+
uses: actions/checkout@v5
57+
- name: Unarchiving dist directory
58+
uses: actions/download-artifact@v5
59+
with:
60+
name: dist
61+
path: ${{ github.workspace }}/dist
62+
- name: Use Node.js ${{ matrix.node-version }}
63+
uses: actions/setup-node@v6
64+
with:
65+
node-version: ${{ matrix.node-version }}
66+
- name: Cache node modules
67+
uses: actions/cache@v4
68+
env:
69+
cache-name: cache-node-modules
70+
with:
71+
path: ~/.npm
72+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
73+
restore-keys: |
74+
${{ runner.os }}-build-${{ env.cache-name }}-
75+
${{ runner.os }}-build-
76+
${{ runner.os }}-
77+
- name: Install dependencies
78+
run: npm ci
79+
- name: Run test
80+
run: npm run cov
81+
- name: Run test sql
82+
if: ${{ matrix.node-version >= 22 }}
83+
run: npm run test:sql
84+
deploy:
85+
runs-on: ubuntu-latest
86+
timeout-minutes: 15
87+
needs: [build, test]
88+
env:
89+
NODE_VERSION: 22
90+
steps:
91+
- name: Checkout repo
92+
uses: actions/checkout@v5
93+
- name: Unarchiving dist directory
94+
uses: actions/download-artifact@v5
95+
with:
96+
name: dist
97+
path: ${{ github.workspace }}/dist
98+
- name: Use Node.js ${{ env.NODE_VERSION }}
99+
uses: actions/setup-node@v6
100+
with:
101+
node-version: ${{ env.NODE_VERSION }}
102+
- name: Cache node modules
103+
uses: actions/cache@v4
104+
env:
105+
cache-name: cache-node-modules
106+
with:
107+
path: ~/.npm
108+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
109+
restore-keys: |
110+
${{ runner.os }}-build-${{ env.cache-name }}-
111+
${{ runner.os }}-build-
112+
${{ runner.os }}-
113+
- name: Install modules
114+
run: npm ci
115+
- name: Set RELEASE_VERSION env
116+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
117+
- name: Create Release
118+
id: create_release
119+
uses: softprops/action-gh-release@v2
120+
with:
121+
tag_name: ${{ github.ref }}
122+
name: v${{ env.RELEASE_VERSION }}
123+
body_path: ${{ github.workspace }}/README.md
124+
repository: dudko-dev/docdb
125+
token: ${{ secrets.TOKEN_FOR_WORKFLOW }}
126+
draft: false
127+
prerelease: ${{ !!endsWith(env.RELEASE_VERSION, '-beta') }}
128+
- name: Set registry npm packages
129+
if: ${{ !endsWith(env.RELEASE_VERSION, '-beta') }}
130+
uses: actions/setup-node@v6
131+
with:
132+
registry-url: "https://registry.npmjs.org"
133+
- name: Update npm to latest version
134+
run: npm install -g npm@latest
135+
- name: Publish package to NPM
136+
if: ${{ !endsWith(env.RELEASE_VERSION, '-beta') }}
137+
run: npm publish

.gitignore

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,42 @@
11
$ cat .gitignore
2+
# Dependencies
23
node_modules
3-
test
4-
docdb
4+
5+
# Build output
6+
lib
7+
dist
8+
9+
# Coverage and testing
10+
.nyc_output
11+
coverage
12+
13+
# Logs
14+
*.log
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
19+
# Runtime data
20+
pids
21+
*.pid
22+
*.seed
23+
*.pid.lock
24+
25+
# IDE
26+
.vscode
27+
.idea
28+
*.swp
29+
*.swo
30+
31+
# OS generated files
32+
.DS_Store
33+
.DS_Store?
34+
._*
35+
.Spotlight-V100
36+
.Trashes
37+
ehthumbs.db
38+
Thumbs.db
39+
40+
# Temporary files
41+
*.tmp
42+
*.temp

.npmignore

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
1-
.gitignore
1+
# Development files
2+
.github
3+
.nyc_output
24
node_modules
5+
src
36
test
4-
docdb
7+
examples
8+
fix-esm-imports.js
9+
ignoreUpdatesModules.json
10+
11+
# Config files
12+
eslint.config.mjs
13+
.gitignore
14+
.npmignore
15+
package-lock.json
16+
tsconfig.json
17+
tsconfig.*.json
18+
tslint.json
19+
typedoc.json
20+
21+
# Logs and temp files
22+
*.log
23+
.vscode
24+
.DS_Store
25+
26+
# Documentation (keep main README.md)
27+
CHANGELOG.md

FUNDING.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
patreon: dudko_dev
2+
custom:
3+
[
4+
"https://dudko.dev/donate",
5+
"https://paypal.me/dudkodev",
6+
"https://www.buymeacoffee.com/dudko.dev",
7+
]

0 commit comments

Comments
 (0)