ci: migrate release publish to github actions
This commit is contained in:
parent
a9082dc012
commit
631188df85
@ -2,15 +2,20 @@ name: Deploy Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- docs/**
|
||||
- CONTRIBUTING.md
|
||||
- CONTRIBUTING.en-US.md
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
deploy-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@ -18,9 +23,9 @@ jobs:
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
|
||||
- name: Install deps
|
||||
@ -10,7 +10,7 @@ jobs:
|
||||
deploy-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@ -18,9 +18,9 @@ jobs:
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
|
||||
- name: Install deps
|
||||
@ -6,6 +6,7 @@ on:
|
||||
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
@ -13,15 +14,15 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
|
||||
- name: Install deps
|
||||
54
.github/workflows/release.yaml
vendored
Normal file
54
.github/workflows/release.yaml
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
name: Add Release Tag
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
uses: ./.github/workflows/lint.yaml
|
||||
|
||||
test:
|
||||
uses: ./.github/workflows/test.yaml
|
||||
|
||||
release:
|
||||
if: github.repository == 'pengzhanbo/vuepress-theme-plume'
|
||||
needs: [test, lint]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24
|
||||
registry-url: https://registry.npmjs.org
|
||||
cache: pnpm
|
||||
|
||||
- name: Install deps
|
||||
run: pnpm install
|
||||
|
||||
- name: Update npm
|
||||
run: npm i -g npm@latest
|
||||
|
||||
- name: Build And Publish
|
||||
id: publish
|
||||
run: |
|
||||
pnpm build
|
||||
pnpm release:publish --no-git-checks
|
||||
pnpm release:sync
|
||||
|
||||
- run: npx changelogithub
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
deploy:
|
||||
uses: ./.github/workflows/docs-deploy.yaml
|
||||
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@ -1,22 +0,0 @@
|
||||
name: Add Release Tag
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
changelog:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- run: npx changelogithub
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
@ -6,6 +6,7 @@ on:
|
||||
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
unit-test:
|
||||
@ -13,15 +14,15 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 22
|
||||
node-version: 24
|
||||
cache: pnpm
|
||||
|
||||
- name: Install deps
|
||||
@ -34,6 +35,6 @@ jobs:
|
||||
|
||||
- name: Upload coverage
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: codecov/codecov-action@v4
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
@ -44,5 +44,9 @@
|
||||
"vue": "^3.5.22",
|
||||
"http-server": "^14.1.1",
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,11 +33,12 @@
|
||||
"lint:css": "stylelint **/*.{css,vue}",
|
||||
"test": "cross-env TZ=Etc/UTC vitest --coverage",
|
||||
"prepare": "husky",
|
||||
"release": "pnpm release:check && pnpm release:version && pnpm -r publish && pnpm release:sync",
|
||||
"release:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
||||
"release:check": "pnpm lint && pnpm build",
|
||||
"release:sync": "node scripts/mirror-sync.mjs",
|
||||
"release:version": "bumpp package.json plugins/*/package.json theme/package.json cli/package.json --execute=\"pnpm release:changelog\" --commit \"build: publish v%s\" --all --tag --push"
|
||||
"release:publish": "pnpm -r publish --tag latest",
|
||||
"release:version": "bumpp package.json plugins/*/package.json theme/package.json cli/package.json --execute=\"pnpm release:changelog\" --commit \"build: publish v%s\" --all --tag --push",
|
||||
"release": "pnpm release:check && pnpm release:version"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "catalog:dev",
|
||||
|
||||
@ -36,7 +36,8 @@
|
||||
"vuepress": "catalog:vuepress"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
},
|
||||
"keyword": [
|
||||
"VuePress",
|
||||
|
||||
@ -115,7 +115,8 @@
|
||||
"mpegts.js": "catalog:peer"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
},
|
||||
"keyword": [
|
||||
"VuePress",
|
||||
|
||||
@ -51,7 +51,8 @@
|
||||
"vue": "catalog:prod"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
},
|
||||
"keyword": [
|
||||
"VuePress",
|
||||
|
||||
@ -8,7 +8,8 @@
|
||||
"homepage": "https://theme-plume.vuejs.press/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git"
|
||||
"url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git",
|
||||
"directory": "theme"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues"
|
||||
@ -151,5 +152,9 @@
|
||||
"swiper": "catalog:peer",
|
||||
"three": "catalog:peer",
|
||||
"vue-router": "catalog:dev"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"provenance": true
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user