Publish Packages #24
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 Packages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'packages/core/**' | |
| - 'packages/actions/**' | |
| - '.github/workflows/publish.yml' | |
| workflow_dispatch: | |
| inputs: | |
| package: | |
| description: 'Package to publish' | |
| required: true | |
| type: choice | |
| options: | |
| - none | |
| - core | |
| - actions | |
| - all | |
| default: none | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish-typescript: | |
| name: Publish TypeScript packages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: https://registry.npmjs.org/ | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --no-frozen-lockfile | |
| - name: Build core | |
| if: inputs.package == 'core' || inputs.package == 'all' | |
| run: pnpm build | |
| working-directory: packages/core | |
| - name: Build actions | |
| if: inputs.package == 'actions' || inputs.package == 'all' | |
| run: pnpm build | |
| working-directory: packages/actions | |
| - name: Publish core | |
| if: inputs.package == 'core' || inputs.package == 'all' | |
| run: | | |
| npm config set provenance true | |
| echo "Publishing @pipeit/core..." | |
| npm publish --access public --no-git-checks | |
| working-directory: packages/core | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Publish actions | |
| if: inputs.package == 'actions' || inputs.package == 'all' | |
| run: | | |
| npm config set provenance true | |
| echo "Publishing @pipeit/actions..." | |
| npm publish --access public --no-git-checks | |
| working-directory: packages/actions | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |