66 - v**
77
88jobs :
9- publish :
10- name : Publish
9+ publish-sql-parser :
10+ name : Publish SQL Parser
1111 runs-on : ubuntu-latest
1212 steps :
1313 - uses : actions/checkout@v3
1414
15+ - name : Read the tag name
16+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
17+
18+ - uses : actions/setup-node@v3
19+ with :
20+ node-version : 16.x
21+ cache : ' yarn'
22+
23+ - name : Set package version from git tag
24+ run : |
25+ GIT_TAG=${{ github.ref_name }}
26+ VERSION="${GIT_TAG#v}"
27+ yarn workspace sql-parser version --new-version ${VERSION} --no-git-tag-version
28+
29+ - run : yarn install
30+ - run : yarn npm:prepublish
31+
32+ # We rename the package dynamically to include the @deepnote namespace
33+ # in the build script instead of renaming it in the package.json
34+ # because other packages depend on it and we want to keep the name the same for tests to pass.
35+ - name : Rename the package
36+ run : npm pkg set name=@deepnote/sql-parser --workspace packages/sql-parser
37+
38+ - name : Configure github packages npm repository
39+ run : |
40+ echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
41+ echo "@deepnote:registry=https://npm.pkg.github.com" >> ~/.npmrc
42+ # We use `npm publish` instead of `yarn publish` because yarn publish
43+
44+ # We use `npm publish` instead of `yarn publish` because yarn publish
45+ # checks if the repository is clean and fails if it's not. This is complicated for us, given we rename
46+ # the package dynamically and we don't want to commit the changes to the package.json.
47+ - name : Publish the sql-parser package
48+ run : npm publish --workspace packages/sql-parser
49+
50+ publish-server :
51+ name : Publish Server
52+ runs-on : ubuntu-latest
53+ needs : publish-sql-parser
54+ steps :
55+ - uses : actions/checkout@v3
56+
1557 - name : Read the tag name
1658 run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
1759
4284
4385 # We use `npm publish` instead of `yarn publish` because yarn publish
4486 # checks if the repository is clean and fails if it's not. This is complicated for us, given we rename
45- # the pacakge dynamically and we don't want to commit the changes to the package.json.
87+ # the package dynamically and we don't want to commit the changes to the package.json.
4688 - name : Publish the server package
47- run : |
48- npm publish --workspace packages/server
89+ run : npm publish --workspace packages/server
0 commit comments