From 6eda801b1caf5737d1074fe03801ebabbbd4423b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Tue, 24 Sep 2024 22:01:29 +0100 Subject: [PATCH] ci: try to get auto publish work --- .drone.yml | 15 +++++++++++++++ um_wasm_loader/ci_publish.sh | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 um_wasm_loader/ci_publish.sh diff --git a/.drone.yml b/.drone.yml index 7c26b16..ba6dc6b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,12 @@ kind: pipeline type: docker name: default +when: + event: + - push + - pull_request + - tag + steps: - name: build (rust) @@ -13,9 +19,18 @@ steps: - name: build (node) image: node:22.9-bookworm + environment: + NPM_TOKEN: + from_secret: NPM_TOKEN commands: - corepack enable - cd um_wasm_loader - pnpm i - BUILD_SKIP_WASM_PACK=1 pnpm build - pnpm pack + - | + if [ -n "${DRONE_TAG}" ]; then + ./ci_publish.sh + else + echo "skip package publish" + fi diff --git a/um_wasm_loader/ci_publish.sh b/um_wasm_loader/ci_publish.sh new file mode 100644 index 0000000..6c4fea9 --- /dev/null +++ b/um_wasm_loader/ci_publish.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo '//git.unlock-music.dev/api/packages/um/npm/:_authToken=${NPM_TOKEN}' > $HOME/.npmrc +pnpm publish --access=public