Merge branch 'release' into dev

This commit is contained in:
LOG1997
2025-12-31 12:47:42 +08:00
committed by GitHub
5 changed files with 32 additions and 68 deletions

View File

@@ -17,6 +17,8 @@
推荐使用`pnpm`来进行包的管理。 推荐使用`pnpm`来进行包的管理。
开发/打包tauri应用程序需要rust环境请自行[安装](https://rustup.rs/)
克隆仓库后,运行: 克隆仓库后,运行:
```bash ```bash

View File

@@ -41,6 +41,7 @@ jobs:
- name: Prepare directories - name: Prepare directories
run: | run: |
mv dist dist-prod mv dist dist-prod
cp dist-prod/index.html dist-prod/404.html
- name: Create production build archive - name: Create production build archive
run: | run: |
@@ -51,26 +52,14 @@ jobs:
with: with:
name: web-build name: web-build
path: dist.zip path: dist.zip
- name: Prepare GitHub Pages artifact
run: |
cp -r dist-prod dist-gh-pages
- name: Upload GitHub Pages artifact - name: Deploy to gh-pages branch
uses: actions/upload-artifact@v4 uses: peaceiris/actions-gh-pages@v3
with: with:
name: github-pages github_token: ${{ secrets.GITHUB_TOKEN }}
path: dist-gh-pages publish_dir: ./dist-prod
publish_branch: gh-pages
- name: Prepare GitHub Pages artifact force_orphan: true
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
publish-tauri: publish-tauri:
permissions: permissions:
@@ -118,37 +107,8 @@ jobs:
prerelease: false prerelease: false
run: pnpm tauri build 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: release:
needs: [build-web, publish-tauri, deploy-gh-pages] needs: [build-web, publish-tauri]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
@@ -167,4 +127,4 @@ jobs:
name: 'Release ${{ github.ref_name }}' name: 'Release ${{ github.ref_name }}'
draft: true draft: true
prerelease: false prerelease: false
generate_release_notes: true generate_release_notes: true

View File

@@ -25,10 +25,10 @@ try {
} else { } else {
console.log('✅ Git tag 版本校验通过'); console.log('✅ Git tag 版本校验通过');
} }
// 获取 tag 指向的提交哈希 // 获取 tag 指向的提交哈希
const tagCommit = execSync(`git rev-list -1 ${tag}`, { encoding: 'utf-8' }).trim(); const tagCommit = execSync(`git rev-list -1 ${tag}`, { encoding: 'utf-8' }).trim();
// 获取当前分支名称 // 获取当前分支名称
let currentBranch; let currentBranch;
try { try {
@@ -37,12 +37,12 @@ try {
console.error('无法获取当前分支名称'); console.error('无法获取当前分支名称');
process.exit(1); process.exit(1);
} }
console.log(`当前分支为: ${currentBranch}`);
// 检查当前分支是否为 release 分支 // 检查当前分支是否为 release 分支
if (currentBranch.startsWith('release/')) { if (currentBranch.startsWith('release')) {
// 如果当前在 release 分支上,检查当前分支的 HEAD 提交是否与 tag 指向的提交一致 // 如果当前在 release 分支上,检查当前分支的 HEAD 提交是否与 tag 指向的提交一致
const currentBranchCommit = execSync(`git rev-parse ${currentBranch}`, { encoding: 'utf-8' }).trim(); const currentBranchCommit = execSync(`git rev-parse ${currentBranch}`, { encoding: 'utf-8' }).trim();
if (tagCommit !== currentBranchCommit) { if (tagCommit !== currentBranchCommit) {
console.log('🏷️ Git tag 指向的提交与当前 release 分支的最新提交不一致'); console.log('🏷️ Git tag 指向的提交与当前 release 分支的最新提交不一致');
console.error(`当前 release 分支 "${currentBranch}" 的最新提交为: ${currentBranchCommit}`); console.error(`当前 release 分支 "${currentBranch}" 的最新提交为: ${currentBranchCommit}`);
@@ -54,27 +54,27 @@ try {
} else { } else {
// 如果当前不在 release 分支上,查找所有 release 分支并检查是否有分支的 HEAD 与 tag 指向的提交一致 // 如果当前不在 release 分支上,查找所有 release 分支并检查是否有分支的 HEAD 与 tag 指向的提交一致
console.log(`🔍 当前在 "${currentBranch}" 分支,检查 tag 指向的提交是否与任何 release 分支的最新提交一致`); console.log(`🔍 当前在 "${currentBranch}" 分支,检查 tag 指向的提交是否与任何 release 分支的最新提交一致`);
// 获取所有本地分支 // 获取所有本地分支
const localBranchesOutput = execSync('git branch --format="%(refname:short)"', { encoding: 'utf-8' }); const localBranchesOutput = execSync('git branch --format="%(refname:short)"', { encoding: 'utf-8' });
const localBranches = localBranchesOutput.split('\n').map(b => b.trim()).filter(b => b); const localBranches = localBranchesOutput.split('\n').map(b => b.trim()).filter(b => b);
// 过滤出 release 分支 // 过滤出 release 分支
const releaseBranches = localBranches.filter(branch => branch.startsWith('release/')); const releaseBranches = localBranches.filter(branch => branch.startsWith('release/'));
if (releaseBranches.length === 0) { if (releaseBranches.length === 0) {
console.log('⚠️ 未找到 release 分支'); console.log('⚠️ 未找到 release 分支');
process.exit(1); process.exit(1);
} }
let foundMatchingBranch = false; let foundMatchingBranch = false;
let matchingBranchName = ''; let matchingBranchName = '';
for (const branch of releaseBranches) { for (const branch of releaseBranches) {
try { try {
// 获取 release 分支的最新提交 // 获取 release 分支的最新提交
const releaseBranchCommit = execSync(`git rev-parse ${branch}`, { encoding: 'utf-8' }).trim(); const releaseBranchCommit = execSync(`git rev-parse ${branch}`, { encoding: 'utf-8' }).trim();
// 检查是否与 tag 指向的提交一致 // 检查是否与 tag 指向的提交一致
if (tagCommit === releaseBranchCommit) { if (tagCommit === releaseBranchCommit) {
foundMatchingBranch = true; foundMatchingBranch = true;
@@ -86,7 +86,7 @@ try {
continue; continue;
} }
} }
if (!foundMatchingBranch) { if (!foundMatchingBranch) {
console.log('🏷️ Git tag 指向的提交与任何 release 分支的最新提交都不一致'); console.log('🏷️ Git tag 指向的提交与任何 release 分支的最新提交都不一致');
console.error(`提供的 tag 为: ${tag}`); console.error(`提供的 tag 为: ${tag}`);

View File

@@ -5,12 +5,14 @@
# log-lottery 🚀🚀🚀🚀 # log-lottery 🚀🚀🚀🚀
[![MIT](https://img.shields.io/github/package-json/v/log1997/log-lottery)](https://github.com/LOG1997/log-lottery) [![github stars](https://img.shields.io/github/stars/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) [![version](https://img.shields.io/github/package-json/v/log1997/log-lottery)](https://github.com/LOG1997/log-lottery)
[![github](https://img.shields.io/badge/Author-log1997-blue.svg)](https://github.com/log1997) [![License MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/LOG1997/log-lottery)
[![vue3](https://img.shields.io/badge/VUE-3-green.svg)](https://github.com/log1997) [![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/node.js.yml)](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)](<https://hub.docker.com/r/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)
</div> </div>
log-lottery是一个可配置可定制化的抽奖应用炫酷3D球体可用于年会抽奖等活动支持奖品、人员、界面、图片音乐配置。 log-lottery是一个可配置可定制化的抽奖应用炫酷3D球体可用于年会抽奖等活动支持奖品、人员、界面、图片音乐配置。

2
src-tauri/Cargo.lock generated
View File

@@ -77,7 +77,7 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]] [[package]]
name = "app" name = "app"
version = "0.5.0" version = "0.5.1"
dependencies = [ dependencies = [
"log", "log",
"serde", "serde",