-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.79 KB
/
Copy pathrelease.yml
File metadata and controls
64 lines (56 loc) · 1.79 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
build-and-release:
runs-on: macos-15
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build app bundle
run: bash scripts/build-app.sh
- name: Code sign (ad-hoc)
run: codesign --force --deep -s - .build/release/BreakTime.app
- name: Create DMG
run: |
STAGING=$(mktemp -d)
cp -r .build/release/BreakTime.app "$STAGING/"
ln -s /Applications "$STAGING/Applications"
hdiutil create -volname BreakTime -srcfolder "$STAGING" -ov -format UDZO BreakTime.dmg
rm -rf "$STAGING"
- name: Generate changelog
id: changelog
run: |
PREV_TAG=$(git tag --sort=-v:refname | grep '^v' | sed -n '2p')
if [ -n "$PREV_TAG" ]; then
LOG=$(git log --pretty=format:"- %s" "$PREV_TAG"..HEAD)
else
LOG=$(git log --pretty=format:"- %s")
fi
{
echo "body<<EOF"
echo "$LOG"
echo ""
echo "## Install"
echo ""
echo "1. Download **BreakTime.dmg** below"
echo "2. Open the DMG and drag BreakTime to Applications"
echo "3. Run this once in Terminal to remove the quarantine flag:"
echo ' ```'
echo " xattr -cr /Applications/BreakTime.app"
echo ' ```'
echo "4. Launch from Applications or Spotlight"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.body }}
files: BreakTime.dmg