Skip to content

Commit

Permalink
Update Workflow file
Browse files Browse the repository at this point in the history
更新 CI
  • Loading branch information
cca2878 authored Apr 22, 2024
1 parent aafee2e commit 522e777
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,27 @@ name: Build CI
on:
push:
branches:
- master
tags-ignore:
- "v*.*.*"
- dev
paths:
- 'src/**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: dev

- name: Get commit hash
run: echo "hash=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ''
node-version: 'latest'

- name: Set version
run: |
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Build Release
on:
push:
tags:
- "v*.*.*"
branches:
- master
workflow_dispatch:

permissions:
Expand All @@ -18,22 +18,29 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ''
node-version: 'latest'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Get version
id: pv
uses: martinbeentjes/[email protected]

- name: Zip dist
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
TAG_NAME=${{ steps.pv.outputs.current-version}}
FILE_NAME=autopcr_web_vue-release_${TAG_NAME}.zip
echo "filename=${FILE_NAME}" >> $GITHUB_ENV
cd dist && zip -r ../${FILE_NAME}.zip .
cd dist && zip -r ../${FILE_NAME} .
- name: Release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.FILE_NAME }}
name: Release-v${{ steps.pv.outputs.current-version}}
tag_name: v${{ steps.pv.outputs.current-version}}
files: ${{ env.filename }}
generate_release_notes: true
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autopcr_vue",
"version": "0.0.2",
"version": "0.0.3",
"private": true,
"scripts": {
"dev": "vite",
Expand Down

0 comments on commit 522e777

Please sign in to comment.