Skip to content

feat: update npm configuration and add CI workflow #4

feat: update npm configuration and add CI workflow

feat: update npm configuration and add CI workflow #4

Workflow file for this run

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