feat: Release @zenithui/fab v1.0.0 with major enhancements, update ze… #71
Workflow file for this run
This file contains hidden or 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: Publish Package to NPM | |
| on: | |
| push: | |
| tags: | |
| - "@zenithui/time-picker@*" | |
| - "@zenithui/day-picker@*" | |
| - "@zenithui/light-box@*" | |
| - "@zenithui/utils@*" | |
| - "@zenithui/tooltip@*" | |
| - "@zenithui/toast@*" | |
| - "@zenithui/fab@*" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Ensures full Git history | |
| ref: main # Ensure you check out a named branch | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "lts/*" # Use the latest LTS version of Node.js | |
| registry-url: "https://registry.npmjs.org/" | |
| - name: Install pnpm | |
| run: npm install -g pnpm | |
| - name: Extract package and version from tag | |
| id: extract | |
| run: | | |
| set -e | |
| TAG_NAME=${{ github.ref_name }} | |
| PACKAGE_SCOPE=$(echo "$TAG_NAME" | cut -d'@' -f2) # Extracts "zenithui/utils@0.1.0" | |
| PACKAGE_NAME=$(echo "$PACKAGE_SCOPE" | cut -d'/' -f2 | cut -d'@' -f1) # Extracts "utils" | |
| PACKAGE_VERSION=$(echo "$PACKAGE_SCOPE" | cut -d'@' -f2) # Extracts "0.1.0" | |
| echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV | |
| echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV | |
| echo "Extracted package name: $PACKAGE_NAME" | |
| echo "Extracted version: $PACKAGE_VERSION" | |
| - name: Navigate to package directory and install dependencies | |
| run: | | |
| set -e | |
| cd packages/@zenithui/$PACKAGE_NAME | |
| pnpm install | |
| - name: Publish package with building | |
| run: | | |
| set -e | |
| cd packages/@zenithui/$PACKAGE_NAME | |
| npm publish --access public --no-git-checks | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Clear build artifacts | |
| run: | | |
| rm -rf packages/@zenithui/$PACKAGE_NAME/dist | |
| - name: Cleanup node_modules | |
| run: rm -rf node_modules |