-
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (69 loc) · 2.36 KB
/
release.yml
File metadata and controls
79 lines (69 loc) · 2.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
name: Build & Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout (full history)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version
id: version
run: |
VERSION=$(grep -m1 'MARKETING_VERSION' iControl.xcodeproj/project.pbxproj \
| tr -d ' ;' | cut -d'=' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"
- name: Build archive
run: |
xcodebuild \
-project iControl.xcodeproj \
-scheme iControl \
-configuration Release \
-archivePath "$PWD/build/iControl.xcarchive" \
archive \
CODE_SIGN_IDENTITY="-" \
CODE_SIGN_STYLE=Manual \
DEVELOPMENT_TEAM="" \
PROVISIONING_PROFILE_SPECIFIER="" \
CODE_SIGNING_REQUIRED=YES \
CODE_SIGNING_ALLOWED=YES
- name: Extract .app from archive
run: |
cp -R "build/iControl.xcarchive/Products/Applications/iControl.app" "build/iControl.app"
- name: Package DMG
run: |
VERSION="${{ steps.version.outputs.version }}"
mkdir -p dmg_staging
cp -R build/iControl.app dmg_staging/
ln -s /Applications dmg_staging/Applications
hdiutil create \
-volname "iControl" \
-srcfolder dmg_staging \
-ov -format UDZO \
"build/iControl-$VERSION.dmg"
- name: Generate release notes
id: notes
run: |
PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$PREV_TAG" ]; then
NOTES=$(git log --pretty=format:"- %s" "$PREV_TAG..HEAD")
else
NOTES=$(git log --pretty=format:"- %s" HEAD)
fi
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.version.outputs.version }}"
gh release create "v$VERSION" \
"build/iControl-$VERSION.dmg#iControl.dmg" \
--title "v$VERSION" \
--notes "${{ steps.notes.outputs.notes }}"