1- name : Publish CLI Stable Release
1+ name : Publish CLI Release
22
33on :
44 push :
55 branches :
6- - stable
6+ - main
77
88jobs :
9- build :
9+ release :
1010 runs-on : ubuntu-latest
1111 permissions :
1212 contents : write
1313 packages : write
1414 steps :
15- - uses : actions/checkout@v4
15+ - name : Checkout
16+ uses : actions/checkout@v4
1617 with :
1718 fetch-depth : 0
18- ref : stable
19+ token : ${{secrets.PAT}}
1920
20- - name : Enable Corepack
21+ - name : Enable Corepack before setting up Node
2122 run : corepack enable
2223
23- - uses : actions/setup-node@v4
24+ - name : Setup Node
25+ uses : actions/setup-node@v4
2426 with :
2527 node-version : " 20.x"
2628
27- - name : Setup npm auth
29+ - name : Authenticate to npm
2830 run : |
2931 echo "registry=https://registry.npmjs.org/" >> .npmrc
3032 echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
33+ npm whoami
3134 env :
3235 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
3336
34- - name : Install and Build
35- run : |
36- yarn install --immutable
37- yarn build
38- yarn test
37+ - name : Install dependencies
38+ run : yarn install --immutable
39+
40+ - name : Build
41+ run : yarn build
42+
43+ - name : Run tests
44+ run : yarn test
3945
4046 - name : Version and Publish
41- run : |
42- git config user.name "${{ github.actor }}"
43- git config user.email "${{ github.actor }}@users.noreply.github.com"
44- yarn version --message "chore(release): %s [skip ci]"
45- yarn publish --access public
4647 env :
48+ GITHUB_TOKEN : ${{ secrets.PAT }}
4749 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
48-
49- - name : Publish to GitHub Packages
5050 run : |
51- echo "registry=https://npm.pkg.github.com/" > .npmrc
51+ # Configure both npm and GitHub Package registries
52+ echo "registry=https://registry.npmjs.org/" > .npmrc
53+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
54+ echo "@niledatabase:registry=https://npm.pkg.github.com" >> .npmrc
5255 echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc
53- yarn publish --access public --registry https://npm.pkg.github.com/
54- env :
55- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56-
57- - name : Create Release
58- uses : actions/github-script@v6
59- with :
60- github-token : ${{ secrets.GITHUB_TOKEN }}
61- script : |
62- const tag = require('./package.json').version;
63- await github.request(`POST /repos/${{ github.repository }}/releases`, {
64- tag_name: "v" + tag,
65- generate_release_notes: true
66- });
56+
57+ # Run semantic-release with prerelease configuration
58+ npx semantic-release
0 commit comments