66 - v**
77
88jobs :
9- publish :
10- name : Publish
9+ publish-server :
10+ name : Publish Server
1111 runs-on : ubuntu-latest
1212 steps :
1313 - uses : actions/checkout@v3
4242
4343 # We use `npm publish` instead of `yarn publish` because yarn publish
4444 # 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.
45+ # the package dynamically and we don't want to commit the changes to the package.json.
4646 - name : Publish the server package
47- run : |
48- npm publish --workspace packages/server
47+ run : npm publish --workspace packages/server
48+
49+ publish-sql-parser :
50+ name : Publish SQL Parser
51+ runs-on : ubuntu-latest
52+ steps :
53+ - uses : actions/checkout@v3
54+
55+ - name : Read the tag name
56+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
57+
58+ - uses : actions/setup-node@v3
59+ with :
60+ node-version : 16.x
61+ cache : ' yarn'
62+
63+ - name : Set package version from git tag
64+ run : |
65+ GIT_TAG=${{ github.ref_name }}
66+ VERSION="${GIT_TAG#v}"
67+ yarn workspace sql-parser version --new-version ${VERSION} --no-git-tag-version
68+
69+ - run : yarn install
70+ - run : yarn npm:prepublish
71+
72+ # We rename the package dynamically to include the @deepnote namespace
73+ # in the build script instead of renaming it in the package.json
74+ # because other packages depend on it and we want to keep the name the same for tests to pass.
75+ - name : Rename the package
76+ run : npm pkg set name=@deepnote/sql-parser --workspace packages/sql-parser
77+
78+ - name : Configure github packages npm repository
79+ run : |
80+ echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
81+ echo "@deepnote:registry=https://npm.pkg.github.com" >> ~/.npmrc
82+ # We use `npm publish` instead of `yarn publish` because yarn publish
83+
84+ # We use `npm publish` instead of `yarn publish` because yarn publish
85+ # checks if the repository is clean and fails if it's not. This is complicated for us, given we rename
86+ # the package dynamically and we don't want to commit the changes to the package.json.
87+ - name : Publish the sql-parser package
88+ run : npm publish --workspace packages/sql-parser
0 commit comments