Compare commits
4
Commits
feat/user-system
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f1f48f54c | ||
|
|
8b4cabba28 | ||
|
|
185a8905f9 | ||
|
|
2b036d2226 |
No files matched your search
@@ -1,7 +1,8 @@
|
|||||||
name: build-bot
|
name: build-bot
|
||||||
|
|
||||||
# 在 Issue / PR 里评论触发编译:
|
# 在 Issue / PR 里评论触发编译:
|
||||||
# @build-bot build mac 编译 macOS
|
# @build-bot build mac 编译 macOS(大小写均可:Mac / MAC)
|
||||||
|
# @build-bot build mac version=1.1.3 编译 macOS 1.1.3(不写 version= 则用仓库当前版本)
|
||||||
# @build-bot build win-amd 编译 Windows amd64
|
# @build-bot build win-amd 编译 Windows amd64
|
||||||
# @build-bot build win-arm 编译 Windows arm64
|
# @build-bot build win-arm 编译 Windows arm64
|
||||||
# @build-bot build all 三个平台全编
|
# @build-bot build all 三个平台全编
|
||||||
@@ -69,8 +70,18 @@ jobs:
|
|||||||
echo "ok=true" >> "$GITHUB_OUTPUT"
|
echo "ok=true" >> "$GITHUB_OUTPUT"
|
||||||
echo "target=$TARGET" >> "$GITHUB_OUTPUT"
|
echo "target=$TARGET" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# 版本号:评论里的 version=x.y.z 优先(大小写不敏感),没有则用仓库当前版本。
|
||||||
|
CLI_VERSION=$(printf '%s' "$BODY" \
|
||||||
|
| grep -oiE 'version[[:space:]]*=[[:space:]]*[0-9]+\.[0-9]+\.[0-9]+' \
|
||||||
|
| head -1 \
|
||||||
|
| sed -E 's/.*=[[:space:]]*//' || true)
|
||||||
|
if [ -n "$CLI_VERSION" ]; then
|
||||||
|
VERSION="$CLI_VERSION"
|
||||||
|
echo "使用评论指定版本:$VERSION"
|
||||||
|
else
|
||||||
VERSION=$(sed -n 's:.*<Version>\(.*\)</Version>.*:\1:p' Directory.Build.props | head -1)
|
VERSION=$(sed -n 's:.*<Version>\(.*\)</Version>.*:\1:p' Directory.Build.props | head -1)
|
||||||
[ -n "$VERSION" ] || VERSION=1.0.0
|
[ -n "$VERSION" ] || VERSION=1.0.0
|
||||||
|
fi
|
||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
# Issue 评论挂在 PR 上时,用 PR 的 head 提交;否则用默认分支最新
|
# Issue 评论挂在 PR 上时,用 PR 的 head 提交;否则用默认分支最新
|
||||||
@@ -101,6 +112,7 @@ jobs:
|
|||||||
ISSUE: ${{ github.event.issue.number }}
|
ISSUE: ${{ github.event.issue.number }}
|
||||||
TARGET: ${{ steps.parse.outputs.target }}
|
TARGET: ${{ steps.parse.outputs.target }}
|
||||||
REF: ${{ steps.parse.outputs.ref }}
|
REF: ${{ steps.parse.outputs.ref }}
|
||||||
|
VERSION: ${{ steps.parse.outputs.version }}
|
||||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
@@ -116,6 +128,7 @@ jobs:
|
|||||||
|
|
||||||
- 来源提交:\`${REF:0:7}\`
|
- 来源提交:\`${REF:0:7}\`
|
||||||
- 目标:\`${TARGET}\`
|
- 目标:\`${TARGET}\`
|
||||||
|
- 版本:\`${VERSION}\`
|
||||||
- 实时日志:${RUN_URL}
|
- 实时日志:${RUN_URL}
|
||||||
|
|
||||||
编译完成后会在这里回复结果。
|
编译完成后会在这里回复结果。
|
||||||
@@ -126,7 +139,7 @@ jobs:
|
|||||||
build-mac:
|
build-mac:
|
||||||
needs: prepare
|
needs: prepare
|
||||||
if: needs.prepare.outputs.ok == 'true' && (needs.prepare.outputs.target == 'mac' || needs.prepare.outputs.target == 'all')
|
if: needs.prepare.outputs.ok == 'true' && (needs.prepare.outputs.target == 'mac' || needs.prepare.outputs.target == 'all')
|
||||||
runs-on: macos-latest
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -136,16 +149,33 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||||
|
|
||||||
|
# NuGet 包缓存:Avalonia / CommunityToolkit 等依赖每次冷下载要几分钟,
|
||||||
|
# 依赖没变时直接命中缓存。key 基于所有 csproj + .props。
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.nuget/packages
|
||||||
|
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/packages.lock.json') }}
|
||||||
|
restore-keys: ${{ runner.os }}-nuget-
|
||||||
|
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||||
channel: stable
|
channel: stable
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
|
# CocoaPods:Pods/ 被 gitignore,Podfile.lock 没变时复用,省掉每次 pod install
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
GC-UI/frontend/macos/Pods
|
||||||
|
~/Library/Caches/CocoaPods
|
||||||
|
key: ${{ runner.os }}-pods-${{ hashFiles('GC-UI/frontend/macos/Podfile.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-pods-
|
||||||
|
|
||||||
- name: 编译 macOS
|
- name: 编译 macOS
|
||||||
env:
|
env:
|
||||||
GC_NO_PROGRESS: '1'
|
GC_NO_PROGRESS: '1'
|
||||||
run: ./build.sh build --targets=mac
|
run: ./build.sh build --targets=mac -version=${{ needs.prepare.outputs.version }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -177,7 +207,7 @@ jobs:
|
|||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
- name: 编译 Windows
|
- name: 编译 Windows
|
||||||
run: ./build.ps1 build
|
run: ./build.ps1 build -Version ${{ needs.prepare.outputs.version }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -236,7 +266,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
cat > notes.md <<EOF
|
cat > notes.md <<EOF
|
||||||
手动触发构建(\`@build-bot build ${TARGET}\`)。
|
手动触发构建(\`@build-bot build ${TARGET} version=${VERSION}\`)。
|
||||||
|
|
||||||
触发人:@${ACTOR}
|
触发人:@${ACTOR}
|
||||||
来源:#${ISSUE}
|
来源:#${ISSUE}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ jobs:
|
|||||||
build-mac:
|
build-mac:
|
||||||
needs: prepare
|
needs: prepare
|
||||||
if: needs.prepare.outputs.ok == 'true'
|
if: needs.prepare.outputs.ok == 'true'
|
||||||
runs-on: macos-latest
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -126,12 +126,28 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||||
|
|
||||||
|
# NuGet 包缓存:依赖没变时省去冷下载
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.nuget/packages
|
||||||
|
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/packages.lock.json') }}
|
||||||
|
restore-keys: ${{ runner.os }}-nuget-
|
||||||
|
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||||
channel: stable
|
channel: stable
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
|
# CocoaPods:Pods/ 被 gitignore,Podfile.lock 没变时复用,省掉 pod install
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
GC-UI/frontend/macos/Pods
|
||||||
|
~/Library/Caches/CocoaPods
|
||||||
|
key: ${{ runner.os }}-pods-${{ hashFiles('GC-UI/frontend/macos/Podfile.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-pods-
|
||||||
|
|
||||||
- name: 环境信息
|
- name: 环境信息
|
||||||
run: |
|
run: |
|
||||||
sw_vers
|
sw_vers
|
||||||
|
|||||||
Reference in new issue
Block a user