diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 3b76551..0000000 --- a/.drone.yml +++ /dev/null @@ -1,38 +0,0 @@ -kind: pipeline -type: docker -name: default - -when: - event: - - push - - pull_request - - tag - -steps: - -- name: test - image: rust:1.81-bookworm - commands: - - cargo test --verbose --all - -- name: build (wasm_pack) - image: rust:1.81-bookworm - commands: - - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - (cd um_wasm && wasm-pack build --release --target web --out-dir ../um_wasm_loader/pkg) - -- name: build (node) - image: node:22.9-bookworm - environment: - NPM_TOKEN: - from_secret: NPM_TOKEN - COREPACK_ENABLE_AUTO_PIN: 0 - BUILD_SKIP_WASM_PACK: 1 - depends_on: - - "build (wasm_pack)" - commands: - - corepack enable - - cd um_wasm_loader - - pnpm i - - pnpm build - - ./ci_publish.sh diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..d49426e --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,35 @@ +name: Build and Deploy +on: [ push ] + +jobs: + build: + runs-on: ubuntu-latest + env: + COREPACK_ENABLE_AUTO_PIN: 0 + BUILD_SKIP_WASM_PACK: 1 + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Test + run: cargo test --verbose --all + - name: Setup wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Build (rust to wasm) + run: | + cd um_wasm + wasm-pack build --release --target web --out-dir ../um_wasm_loader/pkg + - name: Setup pnpm + uses: pnpm/action-setup@v4.0.0 + with: + standalone: true + run_install: | + - cwd: um_wasm_loader + args: [--frozen-lockfile, --strict-peer-dependencies] + - name: Build (wasm) + working-directory: um_wasm_loader + run: pnpm build + - name: Publish + working-directory: um_wasm_loader + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: ./ci_publish.sh diff --git a/um_wasm_loader/ci_publish.sh b/um_wasm_loader/ci_publish.sh index e4f12fd..56268aa 100755 --- a/um_wasm_loader/ci_publish.sh +++ b/um_wasm_loader/ci_publish.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [[ -z "${DRONE_TAG}" ]]; then +if [[ ! "$GITHUB_REF" =~ ^refs/tags/ ]]; then echo "skip package publish, pack only." pnpm pack exit 0