Skip to content

chore(deps): 更新依赖 #10

chore(deps): 更新依赖

chore(deps): 更新依赖 #10

Workflow file for this run

name: Build Production Page
on:
push:
# 由于其它分支为本地测试打包,故只 CI 主线变更
branches: [ wu_main ]
paths-ignore:
- '**.md'
- '**.txt'
- '.github/**'
- '!.github/workflows/**'
jobs:
setup:
name: Setup Project Info
runs-on: ubuntu-latest
outputs:
DIST_SUFFIX: ${{ steps.get-suffix.outputs.DIST_SUFFIX }}
steps:
- name: 🧐 Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: 📙 Get Package Suffix
id: get-suffix
run: |
# 此处通过 jq 从 package.json 获取版本,否则在 depth
# 为 1 时通过 git tag 所读取的版本不准确
sudo apt-get install jq
VERSION=$(jq -r '.version' ./package.json)
COMMIT_COUNT=$(git rev-list --count HEAD)
BUILD_DATE=$(date "+%y%m%d")
HEAD_SHA=$(git rev-parse --short HEAD)
echo "DIST_SUFFIX=v${VERSION}-${COMMIT_COUNT}-${BUILD_DATE}-${HEAD_SHA}" >> $GITHUB_OUTPUT
build:
name: Build Production Page
needs: setup
env:
DIST_NAME: dist-${{ needs.setup.outputs.DIST_SUFFIX }}
runs-on: ubuntu-latest
steps:
- name: 🛠️ Setup environment
id: setup
uses: crrashh1542/action-setup-yarn-berry@v1
- name: ⚙️ Build production pages
id: build
run: |
yarn add @vue/cli
yarn build
- name: 🌐 Upload the build
id: upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.DIST_NAME }}
path: dist
retention-days: 60