Skip to content

Commit

Permalink
chore: Merge branch 'main' into minor
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 8, 2024
2 parents 928af5f + 28db2e6 commit 741d8a0
Show file tree
Hide file tree
Showing 16 changed files with 410 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/canary-minor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:

- run: pnpm install

- run: pnpm release --canary --tag minor
- run: pnpm release --canary --publish --tag minor
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:

- run: pnpm install

- run: pnpm release --canary
- run: pnpm release --canary --publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
135 changes: 3 additions & 132 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,136 +8,7 @@ on:
- main
- minor

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
unit-test:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/[email protected]

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'

- run: pnpm install

- name: Run unit tests
run: pnpm run test-unit

unit-test-windows:
runs-on: windows-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/[email protected]

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'

- run: pnpm install

- name: Run compiler unit tests
run: pnpm run test-unit compiler

- name: Run ssr unit tests
run: pnpm run test-unit server-renderer

e2e-test:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v4

- name: Setup cache for Chromium binary
uses: actions/cache@v4
with:
path: ~/.cache/puppeteer
key: chromium-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install pnpm
uses: pnpm/[email protected]

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'

- run: pnpm install
- run: node node_modules/puppeteer/install.mjs

- name: Run e2e tests
run: pnpm run test-e2e

- name: verify treeshaking
run: node scripts/verify-treeshaking.js

lint-and-test-dts:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/[email protected]

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'

- run: pnpm install

- name: Run eslint
run: pnpm run lint

- name: Run prettier
run: pnpm run format-check

- name: Run type declaration tests
run: pnpm run test-dts

# benchmarks:
# runs-on: ubuntu-latest
# if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
# env:
# PUPPETEER_SKIP_DOWNLOAD: 'true'
# steps:
# - uses: actions/checkout@v4

# - name: Install pnpm
# uses: pnpm/[email protected]

# - name: Install Node.js
# uses: actions/setup-node@v4
# with:
# node-version-file: '.node-version'
# cache: 'pnpm'

# - run: pnpm install

# - name: Run benchmarks
# uses: CodSpeedHQ/action@v2
# with:
# run: pnpm vitest bench --run
# token: ${{ secrets.CODSPEED_TOKEN }}
test:
if: ${{ ! startsWith(github.event.head_commit.message, 'release:') && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) }}
uses: ./.github/workflows/test.yml
28 changes: 0 additions & 28 deletions .github/workflows/release-gh.yml

This file was deleted.

63 changes: 12 additions & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,18 @@
name: Release

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to publish'
required: true
default: 'main'
type: choice
options:
- main
- minor
bump:
description: 'Bump version'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- prepatch
- preminor
- custom
custom_version:
description: 'Custom version'
required: false
default: ''
type: string
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
test:
uses: ./.github/workflows/test.yml

release:
# prevents this action from running on forks
if: github.repository == 'vuejs/core'
needs: [test]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -41,8 +22,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

- name: Install pnpm
uses: pnpm/action-setup@v4
Expand All @@ -57,38 +36,20 @@ jobs:
- name: Install deps
run: pnpm install

- name: Configure git user as vue bot
- name: Build and publish
id: publish
run: |
git config user.name "vue-bot"
git config user.email "<[email protected]>"
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- name: Run release script
id: release
run: |
pnpm release ${{ inputs.bump != 'custom' && inputs.bump || inputs.custom_version }} --skipPrompts
RELEASE_TAG=$(git describe --tags --abbrev=0)
echo "tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
pnpm release --publishOnly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Push tags
run: git push -u origin ${{ inputs.branch }} --follow-tags

- name: Create Release for Tag
- name: Create GitHub release
id: release_tag
uses: yyx990803/release-tag@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release.outputs.tag }}
tag_name: ${{ github.ref }}
body: |
For stable releases, please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/main/CHANGELOG.md) for details.
For pre-releases, please refer to [CHANGELOG.md](https://github.com/vuejs/core/blob/minor/CHANGELOG.md) of the `minor` branch.
12 changes: 8 additions & 4 deletions .github/workflows/size-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ jobs:
name: size-data
path: temp/size

- name: Save PR number
- name: Save PR number & base branch
if: ${{github.event_name == 'pull_request'}}
run: echo ${{ github.event.number }} > ./pr.txt
run: |
echo ${{ github.event.number }} > ./number.txt
echo ${{ github.base_ref }} > ./base.txt
- uses: actions/upload-artifact@v4
if: ${{github.event_name == 'pull_request'}}
with:
name: pr-number
path: pr.txt
name: pr-info
path: |
number.txt
base.txt
16 changes: 11 additions & 5 deletions .github/workflows/size-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,24 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Download PR number
- name: Download PR info
uses: dawidd6/action-download-artifact@v6
with:
name: pr-number
name: pr-info
run_id: ${{ github.event.workflow_run.id }}
path: /tmp/pr-number
path: /tmp/pr-info

- name: Read PR Number
id: pr-number
uses: juliangruber/read-file-action@v1
with:
path: /tmp/pr-number/pr.txt
path: /tmp/pr-info/number.txt

- name: Read PR base branch
id: pr-base
uses: juliangruber/read-file-action@v1
with:
path: /tmp/pr-info/base.txt

- name: Download Size Data
uses: dawidd6/action-download-artifact@v6
Expand All @@ -58,7 +64,7 @@ jobs:
- name: Download Previous Size Data
uses: dawidd6/action-download-artifact@v6
with:
branch: ${{ github.base_ref }}
branch: ${{ steps.pr-base.outputs.content }}
workflow: size-data.yml
event: push
name: size-data
Expand Down
Loading

0 comments on commit 741d8a0

Please sign in to comment.