Skip to content

Commit 36e1666

Browse files
committed
Default output to table format and add binary release workflow
1 parent a64fde1 commit 36e1666

File tree

3 files changed

+80
-2
lines changed

3 files changed

+80
-2
lines changed

.github/workflows/release.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
jobs:
9+
release:
10+
name: Build and Release
11+
runs-on: macos-26
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Xcode
19+
uses: maxim-lobanov/setup-xcode@v1
20+
with:
21+
xcode-version: '26.2'
22+
23+
- name: Run tests
24+
run: swift test
25+
26+
- name: Build arm64
27+
run: swift build -c release --arch arm64
28+
29+
- name: Build x86_64
30+
run: swift build -c release --arch x86_64
31+
32+
- name: Create universal binary
33+
run: |
34+
mkdir -p .build/universal
35+
lipo -create \
36+
.build/arm64-apple-macosx/release/xcodecloud \
37+
.build/x86_64-apple-macosx/release/xcodecloud \
38+
-output .build/universal/xcodecloud
39+
40+
- name: Ad-hoc codesign
41+
run: codesign --force --sign - .build/universal/xcodecloud
42+
43+
- name: Verify binary
44+
run: |
45+
file .build/universal/xcodecloud
46+
.build/universal/xcodecloud --version
47+
48+
- name: Package binary
49+
run: |
50+
cd .build/universal
51+
tar czf xcodecloud-macos-universal.tar.gz xcodecloud
52+
shasum -a 256 xcodecloud-macos-universal.tar.gz > xcodecloud-macos-universal.tar.gz.sha256
53+
54+
- name: Generate release notes
55+
id: notes
56+
run: |
57+
TAG=${GITHUB_REF#refs/tags/}
58+
# Extract notes for this version from CHANGELOG.md if it exists
59+
if [ -f CHANGELOG.md ]; then
60+
# Get content between this version header and the next
61+
NOTES=$(sed -n "/^## .*${TAG}/,/^## /{ /^## .*${TAG}/d; /^## /d; p; }" CHANGELOG.md)
62+
fi
63+
if [ -z "$NOTES" ]; then
64+
NOTES="Release ${TAG}"
65+
fi
66+
# Write to file to preserve newlines
67+
echo "$NOTES" > /tmp/release-notes.md
68+
69+
- name: Create GitHub Release
70+
env:
71+
GH_TOKEN: ${{ github.token }}
72+
run: |
73+
TAG=${GITHUB_REF#refs/tags/}
74+
gh release create "$TAG" \
75+
--title "$TAG" \
76+
--notes-file /tmp/release-notes.md \
77+
.build/universal/xcodecloud-macos-universal.tar.gz \
78+
.build/universal/xcodecloud-macos-universal.tar.gz.sha256

Sources/XcodeCloudCLI/CLI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public struct XcodeCloud: ParsableCommand {
4242
https://github.com/yapstudios/xcodecloud-cli
4343
https://raw.githubusercontent.com/yapstudios/xcodecloud-cli/main/README.md
4444
""",
45-
version: "1.2.3",
45+
version: "1.2.4",
4646
subcommands: [
4747
InteractiveCommand.self,
4848
AuthCommand.self,

Sources/XcodeCloudCLI/Options/GlobalOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct GlobalOptions: ParsableArguments {
1919
var privateKey: String?
2020

2121
@Option(name: [.customShort("o"), .long], help: "Output format: json, table, csv")
22-
var output: OutputFormat = .json
22+
var output: OutputFormat = .table
2323

2424
@Flag(name: .long, help: "Pretty-print JSON output")
2525
var pretty: Bool = false

0 commit comments

Comments
 (0)