forked from joe-re/sql-language-server
-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (71 loc) · 3.33 KB
/
publish.yaml
File metadata and controls
86 lines (71 loc) · 3.33 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Publish
on:
push:
tags:
# This is triggered when new tag starting with v is pushed to the repository.
- v**
jobs:
publish-sql-parser:
name: Publish SQL Parser
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read the tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: 22.x
cache: 'yarn'
- run: yarn install
- run: yarn npm:prepublish
# We rename the package dynamically to include the @deepnote namespace
# in the build script instead of renaming it in the package.json
# because other packages depend on it and we want to keep the name the same for tests to pass.
- name: Rename the package
run: npm pkg set name=@deepnote/sql-parser --workspace packages/sql-parser
- name: Configure github packages npm repository
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
echo "@deepnote:registry=https://npm.pkg.github.com" >> ~/.npmrc
# We use `npm publish` instead of `yarn publish` because yarn publish
# We use `npm publish` instead of `yarn publish` because yarn publish
# checks if the repository is clean and fails if it's not. This is complicated for us, given we rename
# the package dynamically and we don't want to commit the changes to the package.json.
- name: Publish the sql-parser package
run: |
GIT_TAG=${{ github.ref_name }}
VERSION="${GIT_TAG#v}"
yarn workspace @deepnote/sql-parser version --new-version ${VERSION} --no-git-tag-version && npm publish --workspace packages/sql-parser
publish-server:
name: Publish Server
runs-on: ubuntu-latest
needs: publish-sql-parser
steps:
- uses: actions/checkout@v3
- name: Read the tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/setup-node@v3
with:
node-version: 22.x
cache: 'yarn'
- name: Set package version from git tag
run: |
GIT_TAG=${{ github.ref_name }}
VERSION="${GIT_TAG#v}"
yarn workspace sql-language-server version --new-version ${VERSION} --no-git-tag-version
- run: yarn install
- run: yarn npm:prepublish
# We rename the package dynamically to include the @deepnote namespace
# in the build script instead of renaming it in the package.json
# because other packages depend on it and we want to keep the name the same for tests to pass.
- name: Rename the package
run: npm pkg set name=@deepnote/sql-language-server --workspace packages/server
- name: Configure github packages npm repository
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
echo "@deepnote:registry=https://npm.pkg.github.com" >> ~/.npmrc
# We use `npm publish` instead of `yarn publish` because yarn publish
# checks if the repository is clean and fails if it's not. This is complicated for us, given we rename
# the package dynamically and we don't want to commit the changes to the package.json.
- name: Publish the server package
run: npm publish --workspace packages/server