|
71 | 71 | ### Installation |
72 | 72 | |
73 | 73 | \`\`\`bash |
74 | | - brew tap manucodin/SwiftMockGenerator |
| 74 | + brew tap manucodin/swift-mock-generator |
75 | 75 | brew install swift-mock-generator |
76 | 76 | \`\`\` |
77 | 77 | INSTALL_EOF |
@@ -120,45 +120,53 @@ jobs: |
120 | 120 | |
121 | 121 | echo "sha256=$SHA256" >> $GITHUB_OUTPUT |
122 | 122 | |
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 }} |
128 | 129 |
|
129 | 130 | - name: Update Homebrew formula |
130 | 131 | run: | |
131 | 132 | TAG=${{ steps.get_version.outputs.tag }} |
132 | 133 | SHA256=${{ steps.sha256.outputs.sha256 }} |
133 | | - FORMULA_FILE="Formula/swift-mock-generator.rb" |
134 | 134 | |
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" |
137 | 142 | exit 1 |
138 | 143 | fi |
139 | 144 | |
140 | 145 | sed -i '' "s/VERSION_PLACEHOLDER/${TAG}/g" "$FORMULA_FILE" |
141 | 146 | sed -i '' "s/SHA256_PLACEHOLDER/${SHA256}/g" "$FORMULA_FILE" |
| 147 | + |
| 148 | + echo "✅ Updated formula: $FORMULA_FILE" |
142 | 149 | |
143 | 150 | - name: Create branch and push changes |
144 | 151 | run: | |
| 152 | + cd homebrew-tap |
| 153 | + |
145 | 154 | 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" |
147 | 159 | |
148 | 160 | # Check if there are changes |
149 | | - if git diff --quiet Formula/swift-mock-generator.rb; then |
| 161 | + if git diff --quiet; then |
150 | 162 | echo "No changes to commit" |
151 | 163 | exit 0 |
152 | 164 | fi |
153 | 165 | |
154 | 166 | # Create branch, commit and push |
155 | 167 | 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}" |
162 | 170 | git push -u origin "$BRANCH_NAME" |
163 | 171 | |
164 | 172 | echo "✅ Branch '$BRANCH_NAME' created and pushed successfully" |
|
0 commit comments