Skip to content

Commit c80427d

Browse files
committed
using brew for releases
2 parents cb0d178 + 186530e commit c80427d

File tree

7 files changed

+247
-22
lines changed

7 files changed

+247
-22
lines changed

.github/workflows/release.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: macos-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Swift
15+
uses: swift-actions/setup-swift@v2
16+
with:
17+
swift-version: "5.9"
18+
19+
- name: Build PopZeit
20+
run: |
21+
./build.sh
22+
23+
- name: Get version from tag
24+
id: get_version
25+
run: |
26+
VERSION=${GITHUB_REF#refs/tags/v}
27+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
28+
echo "Version: ${VERSION}"
29+
30+
- name: Verify ZIP file
31+
run: |
32+
ls -la build/
33+
if [ ! -f "build/PopZeit-${{ steps.get_version.outputs.version }}.zip" ]; then
34+
echo "Expected ZIP file not found!"
35+
exit 1
36+
fi
37+
38+
- name: Calculate SHA256
39+
id: calculate_sha
40+
run: |
41+
SHA256=$(shasum -a 256 "build/PopZeit-${{ steps.get_version.outputs.version }}.zip" | cut -d' ' -f1)
42+
echo "sha256=${SHA256}" >> $GITHUB_OUTPUT
43+
echo "SHA256: ${SHA256}"
44+
45+
- name: Upload ZIP to release
46+
uses: actions/upload-release-asset@v1
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
upload_url: ${{ github.event.release.upload_url }}
51+
asset_path: ./build/PopZeit-${{ steps.get_version.outputs.version }}.zip
52+
asset_name: PopZeit-${{ steps.get_version.outputs.version }}.zip
53+
asset_content_type: application/zip
54+
55+
- name: Update release description with SHA256
56+
uses: actions/github-script@v7
57+
with:
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
script: |
60+
const release = await github.rest.repos.getRelease({
61+
owner: context.repo.owner,
62+
repo: context.repo.repo,
63+
release_id: ${{ github.event.release.id }}
64+
});
65+
66+
const currentBody = release.data.body || '';
67+
const sha256Info = `\n\n## SHA256 Checksums\n\n\`PopZeit-${{ steps.get_version.outputs.version }}.zip\`: \`${{ steps.calculate_sha.outputs.sha256 }}\`\n\n## Homebrew Cask\n\nTo update the Homebrew Cask formula, use:\n- Version: \`${{ steps.get_version.outputs.version }}\`\n- SHA256: \`${{ steps.calculate_sha.outputs.sha256 }}\``;
68+
69+
await github.rest.repos.updateRelease({
70+
owner: context.repo.owner,
71+
repo: context.repo.repo,
72+
release_id: ${{ github.event.release.id }},
73+
body: currentBody + sha256Info
74+
});

CHANGELOG.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ All notable changes to PopZeit will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.0.1] - 2024-08-20
9+
10+
### Changed
11+
- **Distribution Strategy**: Switched from DMG to Homebrew Cask as primary distribution method
12+
- **Installation**: Multiple installation options now available (Homebrew, install script, direct download, build from source)
13+
- **Build Process**: Updated build script to create ZIP archives instead of DMG files
14+
- **Documentation**: Enhanced README with comprehensive installation instructions
15+
16+
### Added
17+
- Homebrew Cask formula for easy installation via `brew install --cask popzeit`
18+
- One-line install script with automatic quarantine removal
19+
- Automated GitHub Actions workflow for releases
20+
- SHA256 checksum calculation for package verification
21+
- Multiple installation methods to suit different user preferences
22+
23+
### Technical
24+
- ZIP archive distribution eliminates code signing requirements
25+
- Automatic quarantine attribute removal in install script
26+
- GitHub Actions automatically builds and uploads release assets
27+
- Homebrew Cask handles all macOS security requirements seamlessly
28+
29+
### Distribution
30+
- **Primary**: Homebrew Cask (`brew install --cask popzeit`)
31+
- **Alternative**: Install script (`curl -fsSL https://raw.githubusercontent.com/rahulj51/popzeit/main/install.sh | bash`)
32+
- **Manual**: Direct ZIP download from GitHub releases
33+
- **Developer**: Build from source with `./build.sh`
34+
835
## [1.0.0] - 2024-08-19
936

1037
### Added
@@ -60,8 +87,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6087
- Open source for transparency
6188

6289
### Distribution
63-
- Professional DMG installer (156KB)
64-
- Unsigned binary with clear installation instructions
90+
- Homebrew Cask support for easy installation
91+
- ZIP archive distribution (no code signing required)
92+
- One-line install script with quarantine removal
93+
- Multiple installation methods (Homebrew, direct download, build from source)
94+
- Automated GitHub Actions release workflow
6595
- Build scripts for easy compilation
6696
- Comprehensive distribution documentation
6797

PopZeit/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0.0</string>
20+
<string>1.0.1</string>
2121
<key>CFBundleVersion</key>
2222
<string>1</string>
2323
<key>LSMinimumSystemVersion</key>

README.md

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,40 @@ A lightweight macOS menu bar app that instantly converts Unix timestamps to huma
2626
1. Download the latest release from the [Releases](https://github.com/rahulj51/popzeit/releases) page
2727
2. Open the `.dmg` file
2828
3. Drag PopZeit to your Applications folder
29+
30+
### Option 1: Homebrew (Recommended)
31+
```bash
32+
# Install via Homebrew Cask
33+
brew install --cask popzeit
34+
35+
# Update when new versions are available
36+
brew upgrade --cask popzeit
37+
38+
# Uninstall if needed
39+
brew uninstall --cask popzeit
40+
```
41+
42+
### Option 2: Install Script
43+
```bash
44+
# One-line installer (downloads latest release automatically)
45+
curl -fsSL https://raw.githubusercontent.com/rahulj51/popzeit/main/install.sh | bash
46+
```
47+
48+
### Option 3: Manual Download
49+
1. Download the latest `PopZeit-X.X.X.zip` from the [Releases](https://github.com/rahulj51/popzeit/releases) page
50+
2. Extract the ZIP file
51+
3. Move `PopZeit.app` to your Applications folder
52+
>>>>>>> brew
2953
4. Launch PopZeit from Applications
3054

55+
### Option 4: Build from Source
56+
```bash
57+
git clone https://github.com/rahulj51/popzeit
58+
cd popzeit
59+
./build.sh
60+
open build/PopZeit.app
61+
```
62+
3163
### First Launch
3264
1. PopZeit will appear in your menu bar (look for the clock icon)
3365
2. Start copying timestamps to see conversions!
@@ -90,32 +122,40 @@ PopZeit monitors your clipboard for changes. When you copy text that looks like
90122
## Building from Source
91123

92124
### Prerequisites
93-
- Xcode 15.0 or later
94-
- Swift 5.9 or later
125+
- macOS 13.0 or later
126+
- Swift 5.9 or later (included with Xcode Command Line Tools)
95127

96-
### Build Steps
128+
### Quick Build
97129
```bash
98130
# Clone the repository
99131
git clone https://github.com/rahulj51/popzeit.git
100132
cd popzeit
101133

102-
# Build with Swift Package Manager
103-
swift build -c release
134+
# Build using our build script
135+
./build.sh
104136

105-
# Or open in Xcode
106-
open PopZeit.xcodeproj
137+
# Run the app
138+
open build/PopZeit.app
107139
```
108140

109-
### Creating a Release Build
110-
```bash
111-
# Build and archive
112-
xcodebuild -scheme PopZeit -configuration Release archive -archivePath ./build/PopZeit.xcarchive
141+
### What the Build Script Does
142+
The `build.sh` script:
143+
1. Builds the executable with Swift Package Manager
144+
2. Creates a proper macOS app bundle
145+
3. Copies all resources and icons
146+
4. Creates a ZIP archive for distribution
147+
5. Calculates SHA256 hash for Homebrew Cask
113148

114-
# Export for distribution
115-
xcodebuild -exportArchive -archivePath ./build/PopZeit.xcarchive -exportPath ./build -exportOptionsPlist ExportOptions.plist
149+
### Manual Build Steps
150+
```bash
151+
# Build with Swift Package Manager only
152+
swift build -c release
116153

117-
# Sign and notarize (requires Apple Developer account)
118-
./scripts/notarize.sh
154+
# Create app bundle structure manually
155+
mkdir -p build/PopZeit.app/Contents/MacOS
156+
cp .build/release/PopZeit build/PopZeit.app/Contents/MacOS/
157+
cp PopZeit/Info.plist build/PopZeit.app/Contents/
158+
# ... copy resources manually
119159
```
120160

121161
## Troubleshooting

build.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,31 @@ cp PopZeit/Resources/PopZeit.png "$APP_BUNDLE/Contents/Resources/"
4646
# Make the app executable
4747
chmod -R 755 "$APP_BUNDLE"
4848

49+
# Extract version from Info.plist
50+
VERSION=$(plutil -extract CFBundleShortVersionString raw "$APP_BUNDLE/Contents/Info.plist")
51+
52+
# Create ZIP archive for distribution
53+
echo "Creating ZIP archive for distribution..."
54+
cd build
55+
ZIP_NAME="PopZeit-${VERSION}.zip"
56+
zip -r "$ZIP_NAME" PopZeit.app
57+
cd ..
58+
59+
# Calculate SHA256 for Homebrew Cask
60+
SHA256=$(shasum -a 256 "build/$ZIP_NAME" | cut -d' ' -f1)
61+
4962
echo "Build complete!"
5063
echo "App bundle created at: $APP_BUNDLE"
64+
echo "ZIP archive created at: build/$ZIP_NAME"
65+
echo "SHA256: $SHA256"
5166
echo ""
5267
echo "To test the app:"
5368
echo " ./build/PopZeit.app/Contents/MacOS/PopZeit"
5469
echo ""
5570
echo "To run as a proper macOS app:"
5671
echo " open $APP_BUNDLE"
5772
echo ""
58-
echo "Note: This is an unsigned build. For distribution:"
59-
echo " 1. Sign with your Developer ID"
60-
echo " 2. Notarize with Apple"
61-
echo " 3. Create a DMG for distribution"
73+
echo "For Homebrew Cask distribution:"
74+
echo " Version: $VERSION"
75+
echo " Archive: build/$ZIP_NAME"
76+
echo " SHA256: $SHA256"

homebrew-cask/popzeit.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# typed: strict
2+
# frozen_string_literal: true
3+
4+
cask "popzeit" do
5+
version "1.0.1"
6+
sha256 "2d8808a64d719b4551173c78d51b503ee1a72e526ff4143b00ae3c667ac5307c"
7+
8+
url "https://github.com/rahulj51/popzeit/releases/download/v#{version}/PopZeit-#{version}.zip"
9+
name "PopZeit"
10+
desc "Menu bar timestamp converter"
11+
homepage "https://github.com/rahulj51/popzeit"
12+
13+
depends_on macos: ">= :ventura"
14+
15+
app "PopZeit.app"
16+
17+
zap trash: [
18+
"~/Library/Application Support/PopZeit",
19+
"~/Library/Preferences/com.popzeit.PopZeit.plist",
20+
]
21+
end

install.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
# PopZeit Install Script
3+
4+
set -e
5+
6+
echo "Installing PopZeit..."
7+
8+
# Download latest release
9+
LATEST_RELEASE=$(curl -s https://api.github.com/repos/rahulj51/popzeit/releases/latest | grep "tag_name" | cut -d '"' -f 4)
10+
VERSION=${LATEST_RELEASE#v}
11+
DOWNLOAD_URL="https://github.com/rahulj51/popzeit/releases/download/${LATEST_RELEASE}/PopZeit-${VERSION}.zip"
12+
13+
echo "Downloading PopZeit v${VERSION}..."
14+
15+
# Download to temporary location
16+
cd /tmp
17+
curl -L -o PopZeit.zip "$DOWNLOAD_URL"
18+
19+
# Extract
20+
echo "Extracting..."
21+
unzip -q PopZeit.zip
22+
23+
# Remove quarantine attributes (this prevents "damaged app" warnings)
24+
echo "Removing quarantine attributes..."
25+
xattr -dr com.apple.quarantine PopZeit.app 2>/dev/null || true
26+
27+
# Install to Applications
28+
echo "Installing to /Applications..."
29+
if [ -d "/Applications/PopZeit.app" ]; then
30+
echo "Removing existing installation..."
31+
rm -rf "/Applications/PopZeit.app"
32+
fi
33+
34+
mv PopZeit.app /Applications/
35+
36+
# Cleanup
37+
rm PopZeit.zip
38+
39+
echo ""
40+
echo "✅ PopZeit installed successfully!"
41+
echo ""
42+
echo "🚀 PopZeit is now available in your Applications folder."
43+
echo " Launch it to see the timestamp converter in your menu bar."
44+
echo ""
45+
echo "💡 Tip: PopZeit runs as a menu bar app - look for it in your menu bar after launching."

0 commit comments

Comments
 (0)