Skip to content

Commit

Permalink
Update Project.swift to include app versioning and build number place…
Browse files Browse the repository at this point in the history
…holder; modify GitHub Actions workflow to set build number dynamically. Remove outdated Homebrew update workflow file. This enhances version management and streamlines the release process.
  • Loading branch information
ygsgdbd committed Dec 29, 2024
1 parent 8235477 commit a73bd27
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 144 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
- name: Generate Xcode Project
run: |
# 生成基于时间戳的构建号(格式:YYYYMMDDHHmm)
BUILD_NUMBER=$(date "+%Y%m%d%H%M")
# 替换 Project.swift 中的占位符
sed -i '' "s/@BUILD_NUMBER@/$BUILD_NUMBER/g" Project.swift
echo "Build number set to: $BUILD_NUMBER"
tuist generate --no-open
- name: Build App
Expand All @@ -56,11 +61,6 @@ jobs:
"DanceKunKun.dmg" \
"DerivedData/Build/Products/Release/DanceKunKun.app"
- name: Create Source Archives
run: |
zip -r "DanceKunKun-${{ github.ref_name }}-src.zip" . \
-x "*.git*" -x "build/*" -x "*.xcodeproj/*" -x "*.xcworkspace/*" -x "*.dmg" -x "DerivedData/*"
- name: Generate Checksums
run: |
echo "### DanceKunKun ${{ github.ref_name }}" > checksums.txt
Expand All @@ -70,7 +70,7 @@ jobs:
echo "" >> checksums.txt
echo "### SHA-256 Checksums" >> checksums.txt
echo "\`\`\`" >> checksums.txt
shasum -a 256 DanceKunKun.dmg "DanceKunKun-${{ github.ref_name }}-src.zip" >> checksums.txt
shasum -a 256 DanceKunKun.dmg >> checksums.txt
echo "\`\`\`" >> checksums.txt
- name: Release
Expand All @@ -79,7 +79,6 @@ jobs:
with:
files: |
DanceKunKun.dmg
DanceKunKun-${{ github.ref_name }}-src.zip
checksums.txt
body_path: checksums.txt
draft: false
Expand Down
131 changes: 0 additions & 131 deletions .github/workflows/update-homebrew.yml

This file was deleted.

20 changes: 14 additions & 6 deletions Project.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import ProjectDescription

// MARK: - Version
let appVersion = "0.1.3" // 应用版本号
let buildVersion = "@BUILD_NUMBER@" // 构建版本号占位符,会被 GitHub Actions 替换

let project = Project(
name: "DanceKunKun",
options: .options(
Expand All @@ -10,7 +14,9 @@ let project = Project(
base: [
"SWIFT_VERSION": "5.9",
"DEVELOPMENT_LANGUAGE": "zh-Hans",
"SWIFT_EMIT_LOC_STRINGS": "YES"
"SWIFT_EMIT_LOC_STRINGS": "YES",
"MARKETING_VERSION": SettingValue(stringLiteral: appVersion),
"CURRENT_PROJECT_VERSION": SettingValue(stringLiteral: buildVersion)
],
configurations: [
.debug(name: "Debug"),
Expand All @@ -28,15 +34,17 @@ let project = Project(
"LSUIElement": true, // 设置为纯菜单栏应用
"CFBundleDevelopmentRegion": "zh-Hans", // 设置默认开发区域为简体中文
"CFBundleLocalizations": ["zh-Hans", "zh-Hant", "en"], // 支持的语言列表
"AppleLanguages": ["zh-Hans"] // 设置默认语言为简体中文
"AppleLanguages": ["zh-Hans"], // 设置默认语言为简体中文
"NSHumanReadableCopyright": "Copyright © 2024 ygsgdbd. All rights reserved.",
"LSApplicationCategoryType": "public.app-category.utilities",
"LSMinimumSystemVersion": "13.0",
"CFBundleShortVersionString": .string(appVersion), // 市场版本号
"CFBundleVersion": .string(buildVersion) // 构建版本号
]),
sources: ["DanceKunKun/Sources/**"],
resources: [
"DanceKunKun/Resources/**",
.folderReference(path: "DanceKunKun/Resources/zh-Hans.lproj"),
.folderReference(path: "DanceKunKun/Resources/zh-Hant.lproj"),
.folderReference(path: "DanceKunKun/Resources/en.lproj"),
.folderReference(path: "DanceKunKun/Assets"),
.folderReference(path: "DanceKunKun/Assets")
]
)
]
Expand Down

0 comments on commit a73bd27

Please sign in to comment.