mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 20:09:41 +08:00
构建工作流
This commit is contained in:
parent
18ef724dc7
commit
4d3e6f8166
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@ -6,8 +6,7 @@ name: Node.js CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master", "dev" ]
|
branches: [ "master", "dev" ]
|
||||||
pull_request:
|
paths: ["version"]
|
||||||
branches: [ "master" ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -21,6 +20,11 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
version=$(cat version |sed -ne "s/VERSION\s=\s'v\(.*\)'/\1/gp")
|
||||||
|
echo "version=$version" >> $GITHUB_ENV
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@ -30,7 +34,7 @@ jobs:
|
|||||||
run: npm install
|
run: npm install
|
||||||
# Actions构建
|
# Actions构建
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run actions
|
run: npm run actions --tag=${{ env.version }}
|
||||||
# 上传构建产物zip
|
# 上传构建产物zip
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
@ -149,7 +149,7 @@ task('default', series('clean', parallel('css', 'js'), 'zip'))
|
|||||||
task('release', series('clean', 'version', parallel('css', 'js'), 'zip'))
|
task('release', series('clean', 'version', parallel('css', 'js'), 'zip'))
|
||||||
|
|
||||||
// GitHub - Actions模式
|
// GitHub - Actions模式
|
||||||
task('actions', series('clean', parallel('css', 'js'), 'actions-build'))
|
task('actions', series('clean', 'version', parallel('css', 'js'), 'actions-build'))
|
||||||
|
|
||||||
// push模式,需要使用--tag参数指定版本号
|
// push模式,需要使用--tag参数指定版本号
|
||||||
task('push', series('clean', 'version', parallel('css', 'js'), 'zip', 'publish'))
|
task('push', series('clean', 'version', parallel('css', 'js'), 'zip', 'publish'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user