Skip to content

Commit 2528eb4

Browse files
committed
Continue with Homebrew integration. Moved to independent repository
1 parent cacfaaf commit 2528eb4

File tree

3 files changed

+26
-44
lines changed

3 files changed

+26
-44
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
### Installation
7272
7373
\`\`\`bash
74-
brew tap manucodin/SwiftMockGenerator
74+
brew tap manucodin/swift-mock-generator
7575
brew install swift-mock-generator
7676
\`\`\`
7777
INSTALL_EOF
@@ -120,45 +120,53 @@ jobs:
120120
121121
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
122122
123-
- name: Checkout main branch
124-
run: |
125-
# Checkout the main branch (tags are in detached HEAD state)
126-
git checkout develop
127-
git pull origin develop
123+
- name: Checkout Homebrew tap repository
124+
uses: actions/checkout@v4
125+
with:
126+
repository: manucodin/homebrew-swift-mock-generator
127+
path: homebrew-tap
128+
token: ${{ secrets.GITHUB_TOKEN }}
128129

129130
- name: Update Homebrew formula
130131
run: |
131132
TAG=${{ steps.get_version.outputs.tag }}
132133
SHA256=${{ steps.sha256.outputs.sha256 }}
133-
FORMULA_FILE="Formula/swift-mock-generator.rb"
134134
135-
if [ ! -f "$FORMULA_FILE" ]; then
136-
echo "Error: Formula file not found at $FORMULA_FILE"
135+
# Try Formula/ directory first, then root
136+
if [ -f "homebrew-tap/Formula/swift-mock-generator.rb" ]; then
137+
FORMULA_FILE="homebrew-tap/Formula/swift-mock-generator.rb"
138+
elif [ -f "homebrew-tap/swift-mock-generator.rb" ]; then
139+
FORMULA_FILE="homebrew-tap/swift-mock-generator.rb"
140+
else
141+
echo "Error: Formula file not found"
137142
exit 1
138143
fi
139144
140145
sed -i '' "s/VERSION_PLACEHOLDER/${TAG}/g" "$FORMULA_FILE"
141146
sed -i '' "s/SHA256_PLACEHOLDER/${SHA256}/g" "$FORMULA_FILE"
147+
148+
echo "✅ Updated formula: $FORMULA_FILE"
142149
143150
- name: Create branch and push changes
144151
run: |
152+
cd homebrew-tap
153+
145154
TAG=${{ steps.get_version.outputs.tag }}
146-
BRANCH_NAME="update-homebrew-formula-${TAG}"
155+
BRANCH_NAME="update-to-${TAG}"
156+
157+
git config user.name "github-actions[bot]"
158+
git config user.email "github-actions[bot]@users.noreply.github.com"
147159
148160
# Check if there are changes
149-
if git diff --quiet Formula/swift-mock-generator.rb; then
161+
if git diff --quiet; then
150162
echo "No changes to commit"
151163
exit 0
152164
fi
153165
154166
# Create branch, commit and push
155167
git checkout -b "$BRANCH_NAME"
156-
157-
git config user.name "github-actions[bot]"
158-
git config user.email "github-actions[bot]@users.noreply.github.com"
159-
160-
git add Formula/swift-mock-generator.rb
161-
git commit -m "Update Homebrew formula to ${TAG}"
168+
git add .
169+
git commit -m "Update swift-mock-generator to ${TAG}"
162170
git push -u origin "$BRANCH_NAME"
163171
164172
echo "✅ Branch '$BRANCH_NAME' created and pushed successfully"

Formula/swift-mock-generator.rb

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ A powerful Swift CLI tool that automatically generates comprehensive mock object
2828
#### 🍺 Homebrew (Recommended)
2929

3030
```bash
31-
brew tap manucodin/SwiftMockGenerator
31+
brew tap manucodin/swift-mock-generator
3232
brew install swift-mock-generator
3333
```
3434

0 commit comments

Comments
 (0)