Bump the npm-dependencies group in /aipk-design with 18 updates #30
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 to npm | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.14.0' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Update npm for trusted publishing support | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| working-directory: src | |
| run: npm ci | |
| - name: Bump patch version | |
| if: github.ref == 'refs/heads/main' | |
| working-directory: src | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git pull --rebase | |
| npm version minor --no-git-tag-version | |
| NEW_VERSION=$(node -p "require('./package.json').version") | |
| git add package.json | |
| git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]" | |
| git push | |
| - name: Set preview version | |
| if: github.ref != 'refs/heads/main' | |
| working-directory: src | |
| run: | | |
| BASE_VERSION=$(node -p "require('./package.json').version" | sed 's/-.*$//') | |
| SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) | |
| npm version "${BASE_VERSION}-preview.${SHORT_SHA}" --no-git-tag-version | |
| - name: Publish release | |
| if: github.ref == 'refs/heads/main' | |
| working-directory: src | |
| run: npm publish --access public | |
| - name: Publish preview | |
| if: github.ref != 'refs/heads/main' | |
| working-directory: src | |
| run: npm publish --access public --tag preview |