-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (165 loc) · 6.42 KB
/
Copy pathrelease-native.yml
File metadata and controls
173 lines (165 loc) · 6.42 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Native Release
# Tag-triggered release pipeline for the native apps. Tag `vX.Y.Z` to build
# and attach artifacts to a GitHub Release.
#
# IMPORTANT: artifacts remain UNSIGNED until the signing/notarization secrets
# are wired in (see COMMERCIAL-CHECKLIST.md). This workflow is suitable for
# internal/preview validation; a paid stable release must add platform signing.
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
preflight:
name: Release preflight
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify tag and platform versions
run: bash scripts/check-release-version.sh "${GITHUB_REF_NAME}"
macos:
name: macOS (universal .dmg)
runs-on: macos-15
needs: preflight
steps:
- uses: actions/checkout@v4
- name: Swift version
run: swift --version
- name: Contract tests
working-directory: apps/macos
run: swift test
- name: Build + package (arm64 + x86_64)
working-directory: apps/macos
run: scripts/make-app.sh --universal /tmp/dist
- name: Verify bundle
run: |
test -x /tmp/dist/Taskly.app/Contents/MacOS/Taskly
/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' /tmp/dist/Taskly.app/Contents/Info.plist | grep -qx "$(cat VERSION)"
lipo -archs /tmp/dist/Taskly.app/Contents/MacOS/Taskly | grep -q arm64
lipo -archs /tmp/dist/Taskly.app/Contents/MacOS/Taskly | grep -q x86_64
- name: Create DMG
run: |
# DMG contents: app + guided installer + guide + drag target.
mkdir -p /tmp/dist/pkg
mv /tmp/dist/Taskly.app /tmp/dist/pkg/Taskly.app
mv "/tmp/dist/安装 Taskly.command" "/tmp/dist/pkg/安装 Taskly.command"
mv "/tmp/dist/使用说明.txt" "/tmp/dist/pkg/使用说明.txt"
ln -s /Applications /tmp/dist/pkg/Applications
hdiutil create -volname Taskly -srcfolder /tmp/dist/pkg \
-ov -format UDZO "Taskly-${{ github.ref_name }}-macos.dmg"
- uses: actions/upload-artifact@v4
with:
name: macos-dmg
path: Taskly-*.dmg
windows:
name: Windows (portable x64)
runs-on: windows-latest
needs: preflight
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Publish self-contained
run: >
dotnet publish apps/windows/Taskly/Taskly.csproj -c Release
-r win-x64 --self-contained true
-p:Platform=x64
-p:WindowsAppSDKSelfContained=true
-o publish/win-x64
- name: CLI release smoke
shell: bash
run: |
DB=$(mktemp -d)/tasks.db
B=publish/win-x64/Taskly.exe
"$B" mklist "release-smoke" --db "$DB" --json | grep -q '"id"'
ID=$("$B" add "release smoke" --due tomorrow --db "$DB" --quiet)
"$B" list --db "$DB" --json | grep -q 'release smoke'
"$B" done "$ID" --db "$DB" --json --quiet | grep -q '"completed": true'
- name: Zip
run: Compress-Archive -Path publish/win-x64/* -DestinationPath "Taskly-${{ github.ref_name }}-windows-x64.zip"
- name: Pack Velopack release (online updates)
shell: bash
run: |
dotnet tool install -g vpk --version 1.0.1
VER="${GITHUB_REF_NAME#v}"
vpk pack --packId Taskly --packVersion "$VER" \
--packDir publish/win-x64 --mainExe Taskly.exe --packTitle Taskly
mkdir -p vpk-dist
find Releases -type f \( -name "*.nupkg" -o -name "RELEASES" -o -name "*Setup.exe" \) \
-exec cp {} vpk-dist/ \;
ls -la vpk-dist
- uses: actions/upload-artifact@v4
with:
name: windows-zip
path: |
Taskly-*.zip
vpk-dist/*
linux:
name: Linux (tarball)
runs-on: ubuntu-latest
needs: preflight
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: |
sudo apt-get update
sudo apt-get install -y valac meson libgtk-4-dev libadwaita-1-dev \
libsqlite3-dev libnotify-dev pkg-config
- name: Build + test + install into staging dir
working-directory: apps/linux
run: |
meson setup build --buildtype=release --prefix=/usr
meson compile -C build
meson test -C build --verbose
DESTDIR="$(pwd)/staging" meson install -C build
- name: CLI release smoke
working-directory: apps/linux
run: |
DB=$(mktemp -d)/tasks.db
B=build/taskly
$B mklist "release-smoke" --db "$DB" --json | grep -q '"id"'
ID=$($B add "release smoke" --due tomorrow --db "$DB" --quiet)
$B list --db "$DB" --json | grep -q 'release smoke'
$B done "$ID" --db "$DB" --json --quiet | grep -q '"completed": true'
- name: Tarball
working-directory: apps/linux
run: |
tar -czf "../../Taskly-${{ github.ref_name }}-linux-x64.tar.gz" -C staging .
- uses: actions/upload-artifact@v4
with:
name: linux-tarball
path: Taskly-*.tar.gz
release:
name: Attach artifacts to GitHub Release
runs-on: ubuntu-latest
needs: [macos, windows, linux]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- name: Create release and upload
env:
GH_TOKEN: ${{ github.token }}
run: |
# Flatten artifact subdirectories (vpk-dist) before uploading.
find dist -mindepth 2 -type f -exec mv {} dist/ \; 2>/dev/null || true
find dist -mindepth 1 -type d -empty -delete
PREV_TAG="$(git describe --tags --abbrev=0 "${{ github.ref_name }}^" 2>/dev/null || echo "")"
if gh release view "${{ github.ref_name }}" >/dev/null 2>&1; then
gh release upload "${{ github.ref_name }}" --clobber dist/*
elif [ -n "$PREV_TAG" ]; then
gh release create "${{ github.ref_name }}" dist/* \
--title "${{ github.ref_name }}" \
--generate-notes --notes-start-tag "$PREV_TAG"
else
# First release in the repository: no previous tag exists.
gh release create "${{ github.ref_name }}" dist/* \
--title "${{ github.ref_name }}" --generate-notes
fi