mirror of https://github.com/vuejs/core.git
ci: cleanup & fix repo
This commit is contained in:
parent
594cb1412d
commit
daf098ef68
|
@ -14,29 +14,3 @@ jobs:
|
||||||
test:
|
test:
|
||||||
if: ${{ ! startsWith(github.event.head_commit.message, 'release:') && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) }}
|
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
|
uses: ./.github/workflows/test.yml
|
||||||
|
|
||||||
continuous-release:
|
|
||||||
if: github.repository == 'vuejs/core'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: '.node-version'
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: pnpm build --withTypes
|
|
||||||
|
|
||||||
- name: Release
|
|
||||||
run: pnpx pkg-pr-new publish --compact --pnpm './packages/*'
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ permissions:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
close-issues:
|
close-issues:
|
||||||
if: github.repository == 'vuejs/core'
|
if: github.repository == 'vuejs/core-vapor'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: can't reproduce
|
- name: can't reproduce
|
||||||
|
|
|
@ -1,90 +0,0 @@
|
||||||
name: ecosystem-ci trigger
|
|
||||||
|
|
||||||
on:
|
|
||||||
issue_comment:
|
|
||||||
types: [created]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
trigger:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository == 'vuejs/core' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/ecosystem-ci run')
|
|
||||||
steps:
|
|
||||||
- name: Check user permission
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const user = context.payload.sender.login
|
|
||||||
console.log(`Validate user: ${user}`)
|
|
||||||
|
|
||||||
let isVuejsMember = false
|
|
||||||
try {
|
|
||||||
const { status } = await github.rest.orgs.checkMembershipForUser({
|
|
||||||
org: 'vuejs',
|
|
||||||
username: user
|
|
||||||
});
|
|
||||||
|
|
||||||
isVuejsMember = (status === 204)
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (isVuejsMember) {
|
|
||||||
console.log('Allowed')
|
|
||||||
await github.rest.reactions.createForIssueComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
comment_id: context.payload.comment.id,
|
|
||||||
content: '+1',
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
console.log('Not allowed')
|
|
||||||
await github.rest.reactions.createForIssueComment({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
comment_id: context.payload.comment.id,
|
|
||||||
content: '-1',
|
|
||||||
})
|
|
||||||
throw new Error('not allowed')
|
|
||||||
}
|
|
||||||
- name: Get PR info
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
id: get-pr-data
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
console.log(`Get PR info: ${context.repo.owner}/${context.repo.repo}#${context.issue.number}`)
|
|
||||||
const { data: pr } = await github.rest.pulls.get({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
pull_number: context.issue.number
|
|
||||||
})
|
|
||||||
return {
|
|
||||||
num: context.issue.number,
|
|
||||||
branchName: pr.head.ref,
|
|
||||||
repo: pr.head.repo.full_name,
|
|
||||||
commit: pr.head.sha
|
|
||||||
}
|
|
||||||
- name: Trigger run
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
id: trigger
|
|
||||||
env:
|
|
||||||
COMMENT: ${{ github.event.comment.body }}
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.ECOSYSTEM_CI_ACCESS_TOKEN }}
|
|
||||||
result-encoding: string
|
|
||||||
script: |
|
|
||||||
const comment = process.env.COMMENT.trim()
|
|
||||||
const prData = ${{ steps.get-pr-data.outputs.result }}
|
|
||||||
|
|
||||||
const suite = comment.replace(/^\/ecosystem-ci run/, '').trim()
|
|
||||||
|
|
||||||
await github.rest.actions.createWorkflowDispatch({
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: 'ecosystem-ci',
|
|
||||||
workflow_id: 'ecosystem-ci-from-pr.yml',
|
|
||||||
ref: 'main',
|
|
||||||
inputs: {
|
|
||||||
prNumber: '' + prData.num,
|
|
||||||
branchName: prData.branchName,
|
|
||||||
repo: prData.repo,
|
|
||||||
suite: suite === '' ? '-' : suite,
|
|
||||||
commit: prData.commit
|
|
||||||
}
|
|
||||||
})
|
|
|
@ -9,7 +9,7 @@ permissions:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
action:
|
action:
|
||||||
if: github.repository == 'vuejs/core'
|
if: github.repository == 'vuejs/core-vapor'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/lock-threads@v5
|
- uses: dessant/lock-threads@v5
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
name: Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
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
|
|
||||||
id-token: write
|
|
||||||
# Use Release environment for deployment protection
|
|
||||||
environment: Release
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: '.node-version'
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Install deps
|
|
||||||
run: pnpm install
|
|
||||||
|
|
||||||
- name: Build and publish
|
|
||||||
id: publish
|
|
||||||
run: |
|
|
||||||
pnpm release --publishOnly
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
|
|
||||||
- name: Create GitHub release
|
|
||||||
id: release_tag
|
|
||||||
uses: yyx990803/release-tag@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
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.
|
|
|
@ -18,7 +18,7 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
upload:
|
upload:
|
||||||
if: github.repository == 'vuejs/core'
|
if: github.repository == 'vuejs/core-vapor'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -18,7 +18,7 @@ jobs:
|
||||||
size-report:
|
size-report:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: >
|
if: >
|
||||||
github.repository == 'vuejs/core' &&
|
github.repository == 'vuejs/core-vapor' &&
|
||||||
github.event.workflow_run.event == 'pull_request' &&
|
github.event.workflow_run.event == 'pull_request' &&
|
||||||
github.event.workflow_run.conclusion == 'success'
|
github.event.workflow_run.conclusion == 'success'
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -54,17 +54,19 @@ jobs:
|
||||||
- name: Run type declaration tests
|
- name: Run type declaration tests
|
||||||
run: pnpm run test-dts
|
run: pnpm run test-dts
|
||||||
|
|
||||||
release:
|
continuous-release:
|
||||||
|
if: github.repository == 'vuejs/core-vapor'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [unit-test, lint-and-test-dts]
|
needs: [unit-test, lint-and-test-dts]
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
id-token: write
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4.0.0
|
uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
|
@ -73,10 +75,11 @@ jobs:
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- run: pnpm install
|
- name: Install deps
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: pnpm build --withTypes
|
run: pnpm build --withTypes
|
||||||
|
|
||||||
- name: Publish
|
- name: Release
|
||||||
run: pnpm dlx pkg-pr-new@0.0 publish './packages/*' --template './playground' --pnpm
|
run: pnpx pkg-pr-new publish --pnpm './packages/*' --template './playground'
|
||||||
|
|
Loading…
Reference in New Issue