diff --git a/.github/workflows/ci-pack.yml b/.github/workflows/ci-pack.yml new file mode 100644 index 0000000..c7025d7 --- /dev/null +++ b/.github/workflows/ci-pack.yml @@ -0,0 +1,29 @@ +name: CI Build and Pack + +on: + push: + branches: ["main", "dev"] + pull_request: + branches: ["main"] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + with: + submodules: "true" + - uses: pnpm/action-setup@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + - run: npm run build:docker diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0303784..5ad48d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,5 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: "pnpm" - - uses: oven-sh/setup-bun@v1 - with: - bun-version: 1.1.7 - run: pnpm i - run: pnpm build diff --git a/ci/package.json b/ci/package.json deleted file mode 100644 index caaff0f..0000000 --- a/ci/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "extensions", - "module": "index.ts", - "type": "module", - "devDependencies": {}, - "peerDependencies": { - "typescript": "^5.0.0" - } -} \ No newline at end of file diff --git a/ci/pnpm-workspace.yaml b/ci/pnpm-workspace.yaml deleted file mode 100644 index 2874ec1..0000000 --- a/ci/pnpm-workspace.yaml +++ /dev/null @@ -1,3 +0,0 @@ -packages: - - "extensions/*" - - "dev-extensions/*" \ No newline at end of file diff --git a/extensions/download-twitter-video/package.json b/extensions/download-twitter-video/package.json index 6728c64..16922b7 100644 --- a/extensions/download-twitter-video/package.json +++ b/extensions/download-twitter-video/package.json @@ -71,5 +71,8 @@ "tailwindcss": "^3.4.3", "typescript": "^5.2.2", "vite": "^5.2.0" - } + }, + "files": [ + "dist" + ] } \ No newline at end of file diff --git a/extensions/jwt/package.json b/extensions/jwt/package.json index 44a0349..f6f4762 100644 --- a/extensions/jwt/package.json +++ b/extensions/jwt/package.json @@ -80,5 +80,8 @@ "tailwind-merge": "^2.3.0", "tailwind-variants": "^0.2.1", "zod": "^3.23.8" - } + }, + "files": [ + "dist" + ] } \ No newline at end of file diff --git a/extensions/myip/package.json b/extensions/myip/package.json index 1328f38..4f15887 100644 --- a/extensions/myip/package.json +++ b/extensions/myip/package.json @@ -1,8 +1,8 @@ { - "name": "jarvis-ext-myip", + "name": "@huakunshen/jarvis-ext-myip", "version": "0.0.1", "description": "Jarvis IP Extension", - "private": true, + "private": false, "type": "module", "scripts": { "dev": "vite", @@ -64,5 +64,8 @@ "typescript": "~5.4.0", "vite": "^5.2.8", "vue-tsc": "^2.0.11" - } + }, + "files": [ + "dist" + ] } \ No newline at end of file diff --git a/extensions/qrcode/package.json b/extensions/qrcode/package.json index d4a9849..1ff15f6 100644 --- a/extensions/qrcode/package.json +++ b/extensions/qrcode/package.json @@ -73,5 +73,8 @@ "tailwind-merge": "^2.3.0", "tailwind-variants": "^0.2.1", "valibot": "^0.30.0" - } + }, + "files": [ + "dist" + ] } \ No newline at end of file diff --git a/package.json b/package.json index 460cca1..2a6e708 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "build": "turbo build", "dev": "turbo dev", "lint": "turbo lint", - "format": "prettier --write \"**/*.{ts,tsx,md}\"" + "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "clean": "./scripts/clean.sh", + "build:docker": "./scripts/build.sh" }, "repository": { "type": "git", diff --git a/build.sh b/scripts/build.sh old mode 100644 new mode 100755 similarity index 84% rename from build.sh rename to scripts/build.sh index 8d80ab2..7dca5bc --- a/build.sh +++ b/scripts/build.sh @@ -5,7 +5,7 @@ for ext in $(ls extensions); do continue fi echo "Building $ext" - docker run -v $(pwd)/entrypoint.sh:/entrypoint.sh \ + docker run -v $(pwd)/scripts/docker/entrypoint.sh:/entrypoint.sh \ -v $(pwd)/extensions/$ext:/workspace \ -w /workspace --rm \ --platform=linux/amd64 \ diff --git a/scripts/clean.sh b/scripts/clean.sh new file mode 100644 index 0000000..5266d0b --- /dev/null +++ b/scripts/clean.sh @@ -0,0 +1,2 @@ +# find all *.tgz file in extensions/* and remove them +find extensions/ -name "*.tgz" -type f -delete \ No newline at end of file diff --git a/docker/entrypoint.sh b/scripts/docker/entrypoint.sh similarity index 100% rename from docker/entrypoint.sh rename to scripts/docker/entrypoint.sh