ci: try to get auto publish work
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
鲁树人 2024-09-24 22:01:29 +01:00
parent 0edf20354f
commit 6eda801b1c
2 changed files with 19 additions and 0 deletions

View File

@ -2,6 +2,12 @@ kind: pipeline
type: docker type: docker
name: default name: default
when:
event:
- push
- pull_request
- tag
steps: steps:
- name: build (rust) - name: build (rust)
@ -13,9 +19,18 @@ steps:
- name: build (node) - name: build (node)
image: node:22.9-bookworm image: node:22.9-bookworm
environment:
NPM_TOKEN:
from_secret: NPM_TOKEN
commands: commands:
- corepack enable - corepack enable
- cd um_wasm_loader - cd um_wasm_loader
- pnpm i - pnpm i
- BUILD_SKIP_WASM_PACK=1 pnpm build - BUILD_SKIP_WASM_PACK=1 pnpm build
- pnpm pack - pnpm pack
- |
if [ -n "${DRONE_TAG}" ]; then
./ci_publish.sh
else
echo "skip package publish"
fi

View File

@ -0,0 +1,4 @@
#!/bin/bash
echo '//git.unlock-music.dev/api/packages/um/npm/:_authToken=${NPM_TOKEN}' > $HOME/.npmrc
pnpm publish --access=public