From 8a2a2ac168778899dd028d2f84a22ff32a31b02b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 10 Feb 2024 01:26:37 +0800 Subject: [PATCH] ci: publish to npm --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ .github/workflows/release-tag.yml | 27 --------------------------- scripts/release.js | 6 +++--- 3 files changed, 28 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/release-tag.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bddff9e7..8ae0f9ee8 100644 --- a/.github/workflows/ci.yml +++ b/.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 diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml deleted file mode 100644 index 16c6c9c5c..000000000 --- a/.github/workflows/release-tag.yml +++ /dev/null @@ -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. diff --git a/scripts/release.js b/scripts/release.js index 152b501a3..fa897e79b 100644 --- a/scripts/release.js +++ b/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()