fix: update npm registry URL for pnstack in CI workflow and .npmrc #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly UI Package | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' # Run at midnight UTC daily | |
jobs: | |
build-and-publish-nightly: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
registry-url: 'https://npm.pkg.github.com' | |
scope: '@pnstack' | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build and Test | |
working-directory: ./packages/ui | |
run: | | |
pnpm lint | |
pnpm test | |
pnpm build | |
- name: Generate nightly version | |
id: version | |
run: | | |
DATE=$(date +'%Y%m%d') | |
SHA=$(git rev-parse --short HEAD) | |
NIGHTLY_VERSION="0.0.0-nightly.$DATE.$SHA" | |
echo "NIGHTLY_VERSION=$NIGHTLY_VERSION" >> $GITHUB_ENV | |
- name: Update package version | |
working-directory: ./packages/ui | |
run: | | |
npm version $NIGHTLY_VERSION --no-git-tag-version | |
- name: Publish to GitHub Packages | |
working-directory: ./packages/ui | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: pnpm publish --no-git-checks --tag nightly |