build: switch to gitea runner
Some checks failed
Build and Deploy / build (push) Failing after 29s

This commit is contained in:
鲁树人 2025-02-23 17:15:22 +00:00
parent 4c1bcf8fd5
commit c3be4631e5
3 changed files with 36 additions and 39 deletions

View File

@ -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

View File

@ -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

View File

@ -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