workflow: upload-built-packages

This commit is contained in:
Evan You 2024-08-12 08:08:18 +08:00
parent 85ee76f29d
commit 2dc1c31feb
No known key found for this signature in database
GPG Key ID: 00E9AB7A6704CE0A
1 changed files with 12 additions and 9 deletions

View File

@ -1,9 +1,10 @@
name: publish-commit # upload built packages as artifacts for faster ecosystem-ci
name: upload-built-packages
on: on:
workflow_run: workflow_run:
workflows: ['ci'] workflows: ['ci']
branches: [main, minor, test-publish] branches: [main, minor]
types: types:
- completed - completed
@ -25,15 +26,17 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
registry-url: 'https://npm.pkg.github.com' registry-url: 'https://registry.npmjs.org'
cache: 'pnpm' cache: 'pnpm'
- name: Install deps - name: Install deps
run: pnpm install run: pnpm install
- name: Build and publish - name: Build
id: publish run: pnpm build --withTypes
run: |
pnpm release 0.0.0-${{ github.event.workflow_run.head_commit.id }} --tag ${{ github.event.workflow_run.head_branch }} --registry https://npm.pkg.github.com --publishOnly - name: Upload
env: uses: actions/upload-artifact@v4
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with:
name: packages
path: packages/**/dist/*