Skip to content

Commit 90c52a1

Browse files
feat: update release workflow for macOS DMG support and improve caching
1 parent 25be1cc commit 90c52a1

1 file changed

Lines changed: 19 additions & 39 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
- name: Build (sanity check)
3434
run: go build -o /dev/null ./cmd/routatic-proxy
3535

36-
# ── Stage 2: Create Release ──────────────────────────────────────
36+
# ── Stage 2: Build & Release (macOS runner for DMG support) ──────
3737
release:
38-
name: Create Release
38+
name: Build & Release
3939
needs: validate
40-
runs-on: ubuntu-latest
40+
runs-on: macos-latest
4141
outputs:
4242
tag: ${{ steps.version.outputs.tag }}
4343
steps:
@@ -48,6 +48,7 @@ jobs:
4848
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 - uses: actions/setup-go@v5
4949
with:
5050
go-version: "1.25"
51+
cache: true
5152

5253
- name: Determine version
5354
id: version
@@ -116,6 +117,19 @@ jobs:
116117
sha256sum routatic-proxy_* > checksums.txt
117118
cat checksums.txt
118119
120+
- name: Build CGO-enabled binary (for DMG)
121+
env:
122+
VERSION: ${{ steps.version.outputs.version }}
123+
run: |
124+
CGO_ENABLED=1 go build -tags darwin -ldflags "-X main.version=${VERSION}" -o bin/routatic-proxy ./cmd/routatic-proxy
125+
126+
- name: Build macOS DMG
127+
env:
128+
VERSION: ${{ steps.version.outputs.tag }}
129+
run: |
130+
brew install create-dmg
131+
make dmg VERSION=${{ env.VERSION }}
132+
119133
- name: Generate AI Changelog
120134
id: changelog
121135
env:
@@ -124,7 +138,7 @@ jobs:
124138
OPENROUTER_TEMPERATURE: ${{ secrets.OPENROUTER_TEMPERATURE }}
125139
OPENROUTER_MAX_TOKENS: ${{ secrets.OPENROUTER_MAX_TOKENS }}
126140
run: |
127-
sudo apt-get update -qq && sudo apt-get install -y -qq jq curl
141+
brew install jq
128142
129143
# Configuration with defaults
130144
MODEL="${OPENROUTER_MODEL:-openai/gpt-4o-mini}"
@@ -217,41 +231,7 @@ jobs:
217231
files: |
218232
dist/routatic-proxy_*
219233
dist/checksums.txt
220-
221-
# ── Stage 2.5: Build macOS DMG ──────────────────────────────────
222-
release-macos:
223-
name: Build & Release macOS DMG
224-
needs: release
225-
runs-on: macos-latest
226-
steps:
227-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - uses: actions/checkout@v4
228-
229-
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 - uses: actions/setup-go@v5
230-
with:
231-
go-version: "1.25"
232-
cache: true
233-
234-
- name: Install create-dmg
235-
run: brew install create-dmg
236-
237-
- name: Build CGO-enabled binary
238-
env:
239-
VERSION: ${{ needs.release.outputs.tag }}
240-
run: |
241-
VERSION_NO_V="${VERSION#v}"
242-
CGO_ENABLED=1 go build -tags darwin -ldflags "-X main.version=${VERSION_NO_V}" -o bin/routatic-proxy ./cmd/routatic-proxy
243-
244-
- name: Build macOS DMG
245-
env:
246-
VERSION: ${{ needs.release.outputs.tag }}
247-
run: |
248-
make dmg VERSION=${{ env.VERSION }}
249-
250-
- name: Upload DMG to Release
251-
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2 uses: softprops/action-gh-release@v2
252-
with:
253-
tag_name: ${{ needs.release.outputs.tag }}
254-
files: bin/RoutaticProxy.dmg
234+
bin/RoutaticProxy.dmg
255235
256236
# ── Stage 3: Publish Docker Image ───────────────────────────────
257237
docker:

0 commit comments

Comments
 (0)