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:
workflow_run:
workflows: ['ci']
branches: [main, minor, test-publish]
branches: [main, minor]
types:
- completed
@ -25,15 +26,17 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
registry-url: 'https://npm.pkg.github.com'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- name: Install deps
run: pnpm install
- name: Build and publish
id: publish
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
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: pnpm build --withTypes
- name: Upload
uses: actions/upload-artifact@v4
with:
name: packages
path: packages/**/dist/*