2024-05-11 07:03:56 +08:00
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name : Node.js CI
on :
push :
2024-05-11 08:10:54 +08:00
branches : [ "master" , "dev" ]
2024-05-11 09:53:14 +08:00
paths : [ "version" ]
2024-05-11 07:03:56 +08:00
jobs :
build :
runs-on : ubuntu-latest
strategy :
matrix :
2024-05-11 08:07:20 +08:00
node-version : [ 20. x]
2024-05-11 07:03:56 +08:00
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps :
- uses : actions/checkout@v4
2024-05-11 09:53:14 +08:00
- name : version
id : version
run : |
version=$(cat version |sed -ne "s/VERSION\s=\s'v\(.*\)'/\1/gp")
echo "version=$version" >> $GITHUB_ENV
2024-05-11 07:03:56 +08:00
- name : Use Node.js ${{ matrix.node-version }}
2024-05-11 08:07:20 +08:00
uses : actions/setup-node@v4
2024-05-11 07:03:56 +08:00
with :
node-version : ${{ matrix.node-version }}
cache : 'npm'
2024-05-11 07:07:41 +08:00
- name : Install dependencies
2024-05-11 07:08:21 +08:00
run : npm install
2024-05-11 09:27:49 +08:00
# Actions构建
2024-05-11 07:18:27 +08:00
- name : Build
2024-05-11 09:53:14 +08:00
run : npm run actions --tag=${{ env.version }}
2024-05-11 07:59:13 +08:00
# 上传构建产物zip
2024-05-11 07:34:18 +08:00
- name : Upload artifacts
2024-05-11 08:09:16 +08:00
uses : actions/upload-artifact@v4
2024-05-11 07:34:18 +08:00
with :
name : halo-theme-dream2.0-plus
path : dist