-
Notifications
You must be signed in to change notification settings - Fork 6
44 lines (37 loc) · 1.18 KB
/
ci.yml
File metadata and controls
44 lines (37 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: CI
on:
push:
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
CI:
name: CI flow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: "yarn"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Build
run: yarn build
- name: Check if version exists on npm
if: github.ref == 'refs/heads/master'
id: check-version
run: |
VERSION=$(node -p "require('./package.json').version")
if npm view @questdb/sql-grammar@$VERSION version 2>/dev/null; then
echo "Version $VERSION already exists on npm"
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "Version $VERSION does not exist on npm"
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Publish @questdb/sql-grammar to npm
if: github.ref == 'refs/heads/master' && steps.check-version.outputs.exists == 'false'
run: npm publish --provenance --access public