diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4ddf49..7ded471 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,10 @@ name: Build CI on: push: branches: - - master - tags-ignore: - - "v*.*.*" + - dev + paths: + - 'src/**' + workflow_dispatch: jobs: build: @@ -12,6 +13,8 @@ jobs: 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 @@ -19,7 +22,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '' + node-version: 'latest' - name: Set version run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cecafd..47d5f3a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,8 @@ name: Build Release on: push: - tags: - - "v*.*.*" + branches: + - master workflow_dispatch: permissions: @@ -18,7 +18,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '' + node-version: 'latest' - name: Install dependencies run: npm ci @@ -26,14 +26,21 @@ jobs: - name: Build project run: npm run build + - name: Get version + id: pv + uses: martinbeentjes/npm-get-version-action@v1.3.1 + - 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 }} \ No newline at end of file + name: Release-v${{ steps.pv.outputs.current-version}} + tag_name: v${{ steps.pv.outputs.current-version}} + files: ${{ env.filename }} + generate_release_notes: true \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0464022..21b753a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "autopcr_vue", - "version": "0.0.2", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "autopcr_vue", - "version": "0.0.2", + "version": "0.0.3", "dependencies": { "@element-plus/icons-vue": "^2.1.0", "@vueuse/core": "^10.5.0", diff --git a/package.json b/package.json index 7db3321..01ba6ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "autopcr_vue", - "version": "0.0.2", + "version": "0.0.3", "private": true, "scripts": { "dev": "vite",