From 4b8c27737450cbf5eeff769d092b8f16c46331b5 Mon Sep 17 00:00:00 2001 From: log1997 <2694233102@qq.com> Date: Wed, 31 Dec 2025 09:25:41 +0800 Subject: [PATCH 1/6] =?UTF-8?q?build:=20=F0=9F=8F=97=EF=B8=8F=20=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E4=B8=8E=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 12 +----------- .husky/scripts/verifyTagVersion.js | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 940a0a0..9352313 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,16 +51,6 @@ jobs: with: name: web-build path: dist.zip - - - name: Prepare GitHub Pages artifact - run: | - cp -r dist-prod dist-gh-pages - - - name: Upload GitHub Pages artifact - uses: actions/upload-artifact@v4 - with: - name: github-pages - path: dist-gh-pages - name: Prepare GitHub Pages artifact run: | @@ -167,4 +157,4 @@ jobs: name: 'Release ${{ github.ref_name }}' draft: true prerelease: false - generate_release_notes: true \ No newline at end of file + generate_release_notes: true diff --git a/.husky/scripts/verifyTagVersion.js b/.husky/scripts/verifyTagVersion.js index 6fa2fe0..736b78a 100644 --- a/.husky/scripts/verifyTagVersion.js +++ b/.husky/scripts/verifyTagVersion.js @@ -25,10 +25,10 @@ try { } else { console.log('✅ Git tag 版本校验通过'); } - + // 获取 tag 指向的提交哈希 const tagCommit = execSync(`git rev-list -1 ${tag}`, { encoding: 'utf-8' }).trim(); - + // 获取当前分支名称 let currentBranch; try { @@ -37,12 +37,12 @@ try { console.error('无法获取当前分支名称'); process.exit(1); } - + console.log(`当前分支为: ${currentBranch}`); // 检查当前分支是否为 release 分支 - if (currentBranch.startsWith('release/')) { + if (currentBranch.startsWith('release')) { // 如果当前在 release 分支上,检查当前分支的 HEAD 提交是否与 tag 指向的提交一致 const currentBranchCommit = execSync(`git rev-parse ${currentBranch}`, { encoding: 'utf-8' }).trim(); - + if (tagCommit !== currentBranchCommit) { console.log('🏷️ Git tag 指向的提交与当前 release 分支的最新提交不一致'); console.error(`当前 release 分支 "${currentBranch}" 的最新提交为: ${currentBranchCommit}`); @@ -54,27 +54,27 @@ try { } else { // 如果当前不在 release 分支上,查找所有 release 分支并检查是否有分支的 HEAD 与 tag 指向的提交一致 console.log(`🔍 当前在 "${currentBranch}" 分支,检查 tag 指向的提交是否与任何 release 分支的最新提交一致`); - + // 获取所有本地分支 const localBranchesOutput = execSync('git branch --format="%(refname:short)"', { encoding: 'utf-8' }); const localBranches = localBranchesOutput.split('\n').map(b => b.trim()).filter(b => b); - + // 过滤出 release 分支 const releaseBranches = localBranches.filter(branch => branch.startsWith('release/')); - + if (releaseBranches.length === 0) { console.log('⚠️ 未找到 release 分支'); process.exit(1); } - + let foundMatchingBranch = false; let matchingBranchName = ''; - + for (const branch of releaseBranches) { try { // 获取 release 分支的最新提交 const releaseBranchCommit = execSync(`git rev-parse ${branch}`, { encoding: 'utf-8' }).trim(); - + // 检查是否与 tag 指向的提交一致 if (tagCommit === releaseBranchCommit) { foundMatchingBranch = true; @@ -86,7 +86,7 @@ try { continue; } } - + if (!foundMatchingBranch) { console.log('🏷️ Git tag 指向的提交与任何 release 分支的最新提交都不一致'); console.error(`提供的 tag 为: ${tag}`); From 8694236b9d092d1e014938e220b28d94b32ead0d Mon Sep 17 00:00:00 2001 From: log1997 <2694233102@qq.com> Date: Wed, 31 Dec 2025 09:42:31 +0800 Subject: [PATCH 2/6] =?UTF-8?q?build:=20=F0=9F=8F=97=EF=B8=8F=20release.ym?= =?UTF-8?q?l=20github=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 47 ++++++----------------------------- 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9352313..8fee00e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,15 +52,13 @@ jobs: name: web-build path: dist.zip - - name: Prepare GitHub Pages artifact - run: | - cp -r dist-prod dist-gh-pages - - - name: Upload GitHub Pages artifact - uses: actions/upload-artifact@v4 + - name: Deploy to gh-pages branch + uses: peaceiris/actions-gh-pages@v3 with: - name: github-pages - path: dist-gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist-prod + publish_branch: gh-pages + force_orphan: true publish-tauri: permissions: @@ -108,37 +106,8 @@ jobs: prerelease: false run: pnpm tauri build - deploy-gh-pages: - needs: build-web - runs-on: ubuntu-latest - permissions: - contents: read - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - name: Download GitHub Pages artifact - uses: actions/download-artifact@v4 - with: - name: github-pages - path: dist-gh-pages - - - name: Setup Pages - uses: actions/configure-pages@v3 - - - name: Upload to GitHub Pages - uses: actions/deploy-pages@v2 - id: deployment - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist-gh-pages - release: - needs: [build-web, publish-tauri, deploy-gh-pages] + needs: [build-web, publish-tauri] runs-on: ubuntu-latest steps: - name: Checkout code @@ -157,4 +126,4 @@ jobs: name: 'Release ${{ github.ref_name }}' draft: true prerelease: false - generate_release_notes: true + generate_release_notes: true \ No newline at end of file From 2783fb4c0ec93796809d2bb918351bdb75db83b5 Mon Sep 17 00:00:00 2001 From: LOG1997 <2694233102@qq.com> Date: Wed, 31 Dec 2025 09:56:32 +0800 Subject: [PATCH 3/6] Release (#157) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build: 🏗️ 构建与校验 * build: 🏗️ release.yml github action --- .github/workflows/release.yml | 55 ++++-------------------------- .husky/scripts/verifyTagVersion.js | 24 ++++++------- 2 files changed, 19 insertions(+), 60 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 940a0a0..8fee00e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,26 +51,14 @@ jobs: with: name: web-build path: dist.zip - - - name: Prepare GitHub Pages artifact - run: | - cp -r dist-prod dist-gh-pages - - name: Upload GitHub Pages artifact - uses: actions/upload-artifact@v4 + - name: Deploy to gh-pages branch + uses: peaceiris/actions-gh-pages@v3 with: - name: github-pages - path: dist-gh-pages - - - name: Prepare GitHub Pages artifact - run: | - cp -r dist-prod dist-gh-pages - - - name: Upload GitHub Pages artifact - uses: actions/upload-artifact@v4 - with: - name: github-pages - path: dist-gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist-prod + publish_branch: gh-pages + force_orphan: true publish-tauri: permissions: @@ -118,37 +106,8 @@ jobs: prerelease: false run: pnpm tauri build - deploy-gh-pages: - needs: build-web - runs-on: ubuntu-latest - permissions: - contents: read - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - steps: - - name: Download GitHub Pages artifact - uses: actions/download-artifact@v4 - with: - name: github-pages - path: dist-gh-pages - - - name: Setup Pages - uses: actions/configure-pages@v3 - - - name: Upload to GitHub Pages - uses: actions/deploy-pages@v2 - id: deployment - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist-gh-pages - release: - needs: [build-web, publish-tauri, deploy-gh-pages] + needs: [build-web, publish-tauri] runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/.husky/scripts/verifyTagVersion.js b/.husky/scripts/verifyTagVersion.js index 6fa2fe0..736b78a 100644 --- a/.husky/scripts/verifyTagVersion.js +++ b/.husky/scripts/verifyTagVersion.js @@ -25,10 +25,10 @@ try { } else { console.log('✅ Git tag 版本校验通过'); } - + // 获取 tag 指向的提交哈希 const tagCommit = execSync(`git rev-list -1 ${tag}`, { encoding: 'utf-8' }).trim(); - + // 获取当前分支名称 let currentBranch; try { @@ -37,12 +37,12 @@ try { console.error('无法获取当前分支名称'); process.exit(1); } - + console.log(`当前分支为: ${currentBranch}`); // 检查当前分支是否为 release 分支 - if (currentBranch.startsWith('release/')) { + if (currentBranch.startsWith('release')) { // 如果当前在 release 分支上,检查当前分支的 HEAD 提交是否与 tag 指向的提交一致 const currentBranchCommit = execSync(`git rev-parse ${currentBranch}`, { encoding: 'utf-8' }).trim(); - + if (tagCommit !== currentBranchCommit) { console.log('🏷️ Git tag 指向的提交与当前 release 分支的最新提交不一致'); console.error(`当前 release 分支 "${currentBranch}" 的最新提交为: ${currentBranchCommit}`); @@ -54,27 +54,27 @@ try { } else { // 如果当前不在 release 分支上,查找所有 release 分支并检查是否有分支的 HEAD 与 tag 指向的提交一致 console.log(`🔍 当前在 "${currentBranch}" 分支,检查 tag 指向的提交是否与任何 release 分支的最新提交一致`); - + // 获取所有本地分支 const localBranchesOutput = execSync('git branch --format="%(refname:short)"', { encoding: 'utf-8' }); const localBranches = localBranchesOutput.split('\n').map(b => b.trim()).filter(b => b); - + // 过滤出 release 分支 const releaseBranches = localBranches.filter(branch => branch.startsWith('release/')); - + if (releaseBranches.length === 0) { console.log('⚠️ 未找到 release 分支'); process.exit(1); } - + let foundMatchingBranch = false; let matchingBranchName = ''; - + for (const branch of releaseBranches) { try { // 获取 release 分支的最新提交 const releaseBranchCommit = execSync(`git rev-parse ${branch}`, { encoding: 'utf-8' }).trim(); - + // 检查是否与 tag 指向的提交一致 if (tagCommit === releaseBranchCommit) { foundMatchingBranch = true; @@ -86,7 +86,7 @@ try { continue; } } - + if (!foundMatchingBranch) { console.log('🏷️ Git tag 指向的提交与任何 release 分支的最新提交都不一致'); console.error(`提供的 tag 为: ${tag}`); From 04eb5b55783d8845fb0c4fd1a9817aaf76376774 Mon Sep 17 00:00:00 2001 From: LOG1997 <2694233102@qq.com> Date: Wed, 31 Dec 2025 10:18:48 +0800 Subject: [PATCH 4/6] =?UTF-8?q?docs:=20=F0=9F=93=9D=20update=20readme=20(#?= =?UTF-8?q?159)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 74f103d..1d7b5ed 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,14 @@ # log-lottery 🚀🚀🚀🚀 -[![MIT](https://img.shields.io/github/package-json/v/log1997/log-lottery)](https://github.com/LOG1997/log-lottery) -[![MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/LOG1997/log-lottery) -[![github](https://img.shields.io/badge/Author-log1997-blue.svg)](https://github.com/log1997) -[![vue3](https://img.shields.io/badge/VUE-3-green.svg)](https://github.com/log1997) -[![build](https://img.shields.io/github/actions/workflow/status/log1997/log-lottery/node.js.yml)](https://github.com/log1997) - +[![github stars](https://img.shields.io/github/stars/log1997/log-lottery)](https://github.com/LOG1997/log-lottery) +[![version](https://img.shields.io/github/package-json/v/log1997/log-lottery)](https://github.com/LOG1997/log-lottery) +[![License MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/LOG1997/log-lottery) +[![github author](https://img.shields.io/badge/Author-log1997-blue.svg)](https://github.com/log1997) +[![build](https://img.shields.io/github/actions/workflow/status/log1997/log-lottery/release.yml)](https://github.com/log1997) +[![docker](https://img.shields.io/docker/pulls/log1997/log-lottery)]() +[![github downloads](https://img.shields.io/github/downloads/log1997/log-lottery/total)](https://github.com/LOG1997/log-lottery/releases) +[![release data](https://img.shields.io/github/release-date/log1997/log-lottery)](https://github.com/LOG1997/log-lottery/releases) log-lottery是一个可配置可定制化的抽奖应用,炫酷3D球体,可用于年会抽奖等活动,支持奖品、人员、界面、图片音乐配置。 From 2d509ac2d5851afdd037d3ed5a69a341a639e46e Mon Sep 17 00:00:00 2001 From: LOG1997 <2694233102@qq.com> Date: Wed, 31 Dec 2025 10:47:39 +0800 Subject: [PATCH 5/6] Feature docs (#161) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: 📝 update readme * docs(CONTRIBUTING): 添加Tauri开发环境依赖说明 * build: 🏗️ 部署github pages时应该把index.html复制一份成为404.html确保刷新可访问 --- .github/CONTRIBUTING.md | 2 ++ .github/workflows/release.yml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 902eccb..e2cb00c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -17,6 +17,8 @@ 推荐使用`pnpm`来进行包的管理。 +开发/打包tauri应用程序需要rust环境,请自行[安装](https://rustup.rs/) + 克隆仓库后,运行: ```bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8fee00e..969dd5e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,7 @@ jobs: - name: Prepare directories run: | mv dist dist-prod + cp dist-prod/index.html dist-prod/404.html - name: Create production build archive run: | @@ -126,4 +127,4 @@ jobs: name: 'Release ${{ github.ref_name }}' draft: true prerelease: false - generate_release_notes: true \ No newline at end of file + generate_release_notes: true From 6d3bf6df8118de704bc3e0fdc8b4da2eb5246075 Mon Sep 17 00:00:00 2001 From: log1997 <2694233102@qq.com> Date: Wed, 31 Dec 2025 10:50:07 +0800 Subject: [PATCH 6/6] =?UTF-8?q?style:=20=F0=9F=92=84=20update=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 60f0fc1..60ab745 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "log-lottery", "private": true, - "version": "0.5.0", + "version": "0.5.1", "type": "module", "license": "MIT", "scripts": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index c9d8336..a5a2c37 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -77,7 +77,7 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "app" -version = "0.5.0" +version = "0.5.1" dependencies = [ "log", "serde", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 271af99..1b76ac0 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "app" -version = "0.5.0" +version = "0.5.1" description = "A Tauri App" authors = ["you"] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index a96850f..5bde759 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "log-lottery", - "version": "0.5.0", + "version": "0.5.1", "identifier": "to2026.xyz", "build": { "frontendDist": "../dist",