-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (79 loc) · 2.34 KB
/
build.yml
File metadata and controls
93 lines (79 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Build
on:
push:
tags:
- "v*"
workflow_call:
inputs:
tag:
required: true
type: string
permissions:
contents: write
jobs:
build-macos:
name: Build macOS ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
runner: macos-26
- arch: x86_64
runner: macos-26-intel
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.tag || github.ref }}
- uses: swift-actions/setup-swift@v3
with:
swift-version: "6.3"
- name: Build
run: make build
- name: Create zip and checksum
run: |
cd .build
ZIP="go2shell-macOS-${{ matrix.arch }}.zip"
zip -r "$ZIP" go2shell.app
shasum -a 256 "$ZIP" | awk '{print $1}' > "$ZIP.sha256"
echo "SHA256:"
cat "$ZIP.sha256"
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: macos-${{ matrix.arch }}
path: |
.build/go2shell-macOS-${{ matrix.arch }}.zip
.build/go2shell-macOS-${{ matrix.arch }}.zip.sha256
create-release:
name: Create Release
needs: [build-macos]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download all artifacts
uses: actions/download-artifact@v7
with:
path: release-assets
merge-multiple: true
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag || github.ref_name }}
files: release-assets/*
append_body: true
body: |
---
## 📦 下载
| 平台 | 文件 | 说明 |
|------|------|------|
| **macOS (Apple Silicon)** | `go2shell-macOS-arm64.zip` | M1/M2/M3/M4 |
| **macOS (Intel)** | `go2shell-macOS-x86_64.zip` | Intel 芯片 |
> ⚠️ 应用未经 notarize,首次打开可能被 Gatekeeper 拦截:
> ```bash
> xattr -d com.apple.quarantine /Applications/go2shell.app
> ```
> 或前往 系统设置 > 隐私与安全性 > 点击"仍要打开"。
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}