Merge pull request #4 from polarsignals/cli-upload #5
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 | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| name: Publish packages to NPM | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: "0" | |
| token: ${{ secrets.GH_PAT }} | |
| - name: Pull all tags for lerna-lite | |
| run: | | |
| git fetch --depth=1 origin +refs/tags/*:refs/tags/* && \ | |
| git fetch origin +refs/heads/main:refs/remotes/origin/main && \ | |
| git checkout main | |
| - uses: pnpm/action-setup@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: pnpm | |
| - name: Config git user | |
| run: | | |
| git config --global user.name "${{ github.actor }}" | |
| git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm run build | |
| - name: Test | |
| run: pnpm run test | |
| - name: Bump versions and publish packages | |
| run: pnpm run publish:ci | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_PAT }} |