-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 2.22 KB
/
release.yml
File metadata and controls
78 lines (66 loc) · 2.22 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
name: Release
on:
push:
tags:
- '*.*.*'
jobs:
release:
name: Build and Release
runs-on: macos-26
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.2'
- name: Run tests
run: swift test
- name: Build arm64
run: swift build -c release --arch arm64
- name: Build x86_64
run: swift build -c release --arch x86_64
- name: Create universal binary
run: |
mkdir -p .build/universal
lipo -create \
.build/arm64-apple-macosx/release/xcodecloud \
.build/x86_64-apple-macosx/release/xcodecloud \
-output .build/universal/xcodecloud
- name: Ad-hoc codesign
run: codesign --force --sign - .build/universal/xcodecloud
- name: Verify binary
run: |
file .build/universal/xcodecloud
.build/universal/xcodecloud --version
- name: Package binary
run: |
cd .build/universal
tar czf xcodecloud-macos-universal.tar.gz xcodecloud
shasum -a 256 xcodecloud-macos-universal.tar.gz > xcodecloud-macos-universal.tar.gz.sha256
- name: Generate release notes
id: notes
run: |
TAG=${GITHUB_REF#refs/tags/}
# Extract notes for this version from CHANGELOG.md if it exists
if [ -f CHANGELOG.md ]; then
# Get content between this version header and the next
NOTES=$(sed -n "/^## .*${TAG}/,/^## /{ /^## .*${TAG}/d; /^## /d; p; }" CHANGELOG.md)
fi
if [ -z "$NOTES" ]; then
NOTES="Release ${TAG}"
fi
# Write to file to preserve newlines
echo "$NOTES" > /tmp/release-notes.md
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG=${GITHUB_REF#refs/tags/}
gh release create "$TAG" \
--title "$TAG" \
--notes-file /tmp/release-notes.md \
.build/universal/xcodecloud-macos-universal.tar.gz \
.build/universal/xcodecloud-macos-universal.tar.gz.sha256