-
Notifications
You must be signed in to change notification settings - Fork 1
148 lines (124 loc) · 4.36 KB
/
Copy pathbuild.yml
File metadata and controls
148 lines (124 loc) · 4.36 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
name: Build & Test
permissions:
contents: write
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
jobs:
build-cli:
name: Build CLI
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Build CLI (Release)
run: swift build -c release
- name: Run CLI smoke tests
run: |
.build/release/dx --version
.build/release/dx uuid
.build/release/dx hash "test"
.build/release/dx base64 encode "hello"
.build/release/dx epoch now
- name: Upload CLI binary
uses: actions/upload-artifact@v4
with:
name: dx-cli
path: .build/release/dx
build-app:
name: Build macOS App
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Install XcodeGen
run: brew install xcodegen
- name: Generate Xcode Project
run: xcodegen generate
- name: Build App (Release)
run: |
xcodebuild -project DXTools.xcodeproj \
-scheme DXTools \
-configuration Release \
-derivedDataPath build/DerivedData \
build
- name: Run Tests
run: |
xcodebuild -project DXTools.xcodeproj \
-scheme DXToolsTests \
-configuration Debug \
-derivedDataPath build/DerivedData \
CI_ENVIRONMENT=YES \
test
release:
name: Create Release
needs: [build-cli, build-app]
runs-on: macos-15
if: startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'release:'))
steps:
- uses: actions/checkout@v4
- name: Install XcodeGen
run: brew install xcodegen
- name: Build CLI
run: swift build -c release
- name: Build App
run: |
xcodegen generate
xcodebuild -project DXTools.xcodeproj \
-scheme DXTools \
-configuration Release \
-derivedDataPath build/DerivedData \
build
- name: Build .icns from asset catalog
run: |
ICONSET="build/AppIcon.iconset"
mkdir -p "$ICONSET"
SRC="DXTools/Assets.xcassets/AppIcon.appiconset"
for f in icon_16x16.png [email protected] icon_32x32.png [email protected] \
icon_128x128.png [email protected] icon_256x256.png [email protected] \
icon_512x512.png [email protected]; do
cp "$SRC/$f" "$ICONSET/$f"
done
iconutil --convert icns "$ICONSET" --output build/AppIcon.icns
- name: Package DMG
run: |
APP_PATH="build/DerivedData/Build/Products/Release/DX Tools.app"
mkdir -p build/dmg-staging
cp -R "$APP_PATH" build/dmg-staging/
ln -s /Applications build/dmg-staging/Applications
# Set volume icon
cp build/AppIcon.icns build/dmg-staging/.VolumeIcon.icns
SetFile -a C build/dmg-staging 2>/dev/null || true
hdiutil create -volname "DX Tools" \
-srcfolder build/dmg-staging \
-ov -format UDZO \
build/DXTools.dmg
rm -rf build/dmg-staging
- name: Extract version
id: version
run: echo "version=$(grep 'MARKETING_VERSION' project.yml | head -1 | awk '{print $2}' | tr -d '\"')" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: DX Tools v${{ steps.version.outputs.version }}
make_latest: true
body: |
## DX Tools v${{ steps.version.outputs.version }}
### Downloads
- **DXTools.dmg** — macOS app (drag to Applications)
- **dx** — CLI binary (copy to `~/bin/` or `/usr/local/bin/`)
### Install via Homebrew
```
brew tap openstruct/tap && brew install dx-tools
```
### What's Included
- 33 developer tools in one native macOS app
- CLI with 10 subcommands: json, jwt, epoch, env, hash, base64, uuid, color, pass, port
- 300 tests, zero dependencies, ~3 MB
files: |
build/DXTools.dmg
.build/release/dx
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}