Ver Fonte

ci: publish to npm

三咲智子 Kevin Deng há 2 anos atrás
pai
commit
8a2a2ac168
3 ficheiros alterados com 28 adições e 30 exclusões
  1. 25 0
      .github/workflows/ci.yml
  2. 0 27
      .github/workflows/release-tag.yml
  3. 3 3
      scripts/release.js

+ 25 - 0
.github/workflows/ci.yml

@@ -61,6 +61,31 @@ jobs:
       - name: Run type declaration tests
         run: pnpm run test-dts
 
+  release:
+    concurrency:
+      group: release
+    if: github.repository == 'vuejs/core-vapor'
+    runs-on: ubuntu-latest
+    needs: [unit-test, lint-and-test-dts]
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Install pnpm
+        uses: pnpm/action-setup@v2
+
+      - name: Install Node.js
+        uses: actions/setup-node@v4
+        with:
+          node-version-file: '.node-version'
+          registry-url: 'https://registry.npmjs.org'
+          cache: 'pnpm'
+
+      - run: pnpm install
+
+      - run: pnpm release --vapor --skip-tests
+        env:
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+
   # benchmarks:
   #   runs-on: ubuntu-latest
   #   if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

+ 0 - 27
.github/workflows/release-tag.yml

@@ -1,27 +0,0 @@
-on:
-  push:
-    tags:
-      - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
-
-name: Create Release
-
-permissions: {}
-jobs:
-  build:
-    permissions:
-      contents: write # to create release (yyx990803/release-tag)
-
-    name: Create Release
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout code
-        uses: actions/checkout@master
-      - name: Create Release for Tag
-        id: release_tag
-        uses: yyx990803/release-tag@master
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          tag_name: ${{ github.ref }}
-          body: |
-            Please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/main/CHANGELOG.md) for details.

+ 3 - 3
scripts/release.js

@@ -39,8 +39,8 @@ let skipTests = args.skipTests
 const skipBuild = args.skipBuild
 const isCanary = args.canary
 const isVapor = args.vapor
-const skipPrompts = args.skipPrompts || args.canary
-const skipGit = args.skipGit || args.canary
+const skipPrompts = args.skipPrompts || args.canary || args.vapor
+const skipGit = args.skipGit || args.canary || args.vapor
 
 const packages = fs
   .readdirSync(path.resolve(__dirname, '../packages'))
@@ -372,7 +372,7 @@ async function getCIResult() {
   try {
     const sha = await getSha()
     const res = await fetch(
-      `https://api.github.com/repos/vuejs/core/actions/runs?head_sha=${sha}` +
+      `https://api.github.com/repos/vuejs/core-vapor/actions/runs?head_sha=${sha}` +
         `&status=success&exclude_pull_requests=true`,
     )
     const data = await res.json()