Skill站外收录 @skilllib/skill-2117939930272410169
creating-upgrade-test-version
自动生成用于升级测试的版本分支,通过固定构建号和版本号配置,支持应用升级流程验证。根据用户输入的测试版本号与当前日期生成唯一 build number,并在多处配置文件中同步版本信息,确保测试环境的一致性与可追溯性。
开发运维 AI 技能
Skills.MD
# Creating Upgrade Test Version
Automates the creation of test version branches with hardcoded build configurations for testing app upgrade functionality and version migration flows.
## Workflow
### Step 1: Gather Version Information
Ask the user for the test version number using AskUserQuestion:
```
Question: "What test version number should be used?"
Options:
- "9005.20.0" (example format)
- Custom input
```
The version should follow the pattern `9XXX.YY.Z` where:
- `9XXX` indicates a test version (e.g., 9005)
- `YY.Z` matches the production version being tested
### Step 2: Calculate Build Number
Calculate the build number as: **current date (YYYYMMDD) + "00" suffix + 30**
The build number must be 10 digits in format: `YYYYMMDD00 + 30 = YYYYMMDD30`
Example: If today is `20260113`, the build number is `2026011300 + 30 = 2026011330`
```bash
# Calculate build number (10 digits)
DATE=$(date +%Y%m%d)
BUILD_NUMBER=$((${DATE}00 + 30))
echo "Build number: $BUILD_NUMBER" # Output: 2026011330
```
### Step 3: Create and Checkout Branch
Create a new branch named after the test version:
```bash
git checkout -b <test_version>
# Example: git checkout -b 9005.20.0
```
### Step 4: Modify Configuration Files
Modify the following files in order:
#### 4.1 Update `.env.version`
Change the `VERSION` field to the test version:
```
VERSION=<test_version>
BUNDLE_VERSION=1
```
#### 4.2 Update `.github/actions/shared-env/action.yml`
In the "Setup ENV BUILD_NUMBER" steps, replace ALL build number logic with a hardcoded value. Remove the if/else conditions and simplify to:
```yaml
- name: Setup ENV BUILD_NUMBER
shell: bash
run: |
echo "BUILD_NUMBER=<calculated_build_number>" >> $GITHUB_ENV
```
Remove both:
- "Setup ENV BUILD_NUMBER to 1" step
- "Setup ENV BUILD_NUMBER by workflow_run" step
Replace with single step that hardcodes the build number.
#### 4.3 Update `.github/workflows/release-android.yml`
In the "Write .env.version" step, change:
```yaml
echo "BUILD_NUMBER=${{ env.BUILD_NUMBER }}" >> .env.version
```
To:
```yaml
echo "BUILD_NUMBER=<calculated_build_number>" >> .env.version
```
#### 4.4 Update `apps/mobile/android/app/build.gradle`
In the `defaultConfig` block, update:
```gradle
versionCode <calculated_build_number>
versionName "<test_version>"
```
Example:
```gradle
versionCode 2026011330
versionName "9005.20.0"
```
### Step 5: Commit and Push
```bash
git add -A
git commit -m "chore: prepare test version <test_version> with build number <build_number>"
git push -u origin <test_version>
```
## File Locations Summary
| File | Change |
|------|--------|
| `.env.version` | Update VERSION |
| `.github/actions/shared-env/action.yml` | Hardcode BUILD_NUMBER, remove conditionals |
| `.github/workflows/release-android.yml` | Hardcode BUILD_NUMBER in .env.version write |
| `apps/mobile/android/app/build.gradle` | Update versionCode and versionName |
## Example Execution
For test version `9005.20.0` on date `2026-01-13`:
1. Build number = `2026011300 + 30` = `2026011330` (10 digits)
2. Create branch `9005.20.0`
3. Set VERSION=`9005.20.0` in `.env.version`
4. Hardcode BUILD_NUMBER=`2026011330` in shared-env action
5. Hardcode BUILD_NUMBER=`2026011330` in release-android workflow
6. Set versionCode=`2026011330`, versionName=`"9005.20.0"` in build.gradle
7. Commit and push
## Validation Checklist
Before pushing, verify:
- [ ] Branch name matches test version
- [ ] `.env.version` VERSION field updated
- [ ] Build number conditionals removed from shared-env
- [ ] Build number hardcoded in release-android workflow
- [ ] versionCode is numeric (build number)
- [ ] versionName is quoted string (test version)
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「creating-upgrade-test-version」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次