|
1 | 1 | name: Release dmr |
2 | 2 |
|
3 | 3 | # Builds the standalone dmr binary for macOS (arm64), Linux (amd64/arm64), |
4 | | -# and Windows (amd64), publishes a GitHub Release with the archives, then |
5 | | -# opens the corresponding Homebrew formula and WinGet manifest updates so |
6 | | -# `brew install docker/tap/dmr` and `winget install Docker.dmr` pick up the |
7 | | -# new version. |
| 4 | +# and Windows (amd64) and publishes a GitHub Release with the (initially |
| 5 | +# unsigned) archives. |
| 6 | +# |
| 7 | +# macOS/Windows code signing + notarization and the Homebrew cask update live |
| 8 | +# in docker/inference-engine-llama.cpp's release-dmr.yml — an internal repo |
| 9 | +# that holds the Docker code-signing credentials (this repo is public and |
| 10 | +# cannot use them). This workflow auto-triggers it after the release is |
| 11 | +# created; it downloads the macOS/Windows archives from this release, signs |
| 12 | +# and notarizes them, re-uploads the signed versions here, and opens the |
| 13 | +# Homebrew cask PR against docker/homebrew-tap. WinGet is published below. |
8 | 14 | # |
9 | 15 | # Triggered by pushing a tag of the form dmr-vX.Y.Z (kept distinct from the |
10 | 16 | # model-runner container image release tags used by release.yml). |
@@ -94,77 +100,26 @@ jobs: |
94 | 100 | --generate-notes \ |
95 | 101 | dist/* |
96 | 102 |
|
97 | | - publish-homebrew: |
98 | | - name: Publish Homebrew formula |
| 103 | + trigger-signing: |
| 104 | + name: Trigger signing + Homebrew cask |
99 | 105 | needs: release |
100 | 106 | runs-on: ubuntu-latest |
101 | 107 | steps: |
102 | | - - name: Compute release checksums |
103 | | - id: sha |
104 | | - run: | |
105 | | - set -euo pipefail |
106 | | - for target in darwin-arm64 linux-amd64 linux-arm64; do |
107 | | - curl -sL -o "${target}.tar.gz" \ |
108 | | - "https://github.com/${{ github.repository }}/releases/download/${TAG}/dmr-${target}.tar.gz" |
109 | | - sum=$(sha256sum "${target}.tar.gz" | cut -d' ' -f1) |
110 | | - echo "${target//-/_}=${sum}" >> "$GITHUB_OUTPUT" |
111 | | - done |
112 | | -
|
113 | | - - name: Generate formula |
114 | | - run: | |
115 | | - set -euo pipefail |
116 | | - mkdir -p formula |
117 | | - cat > formula/dmr.rb <<RUBY |
118 | | - class Dmr < Formula |
119 | | - desc "Standalone Docker Model Runner — run local models with no Docker Desktop required" |
120 | | - homepage "https://github.com/${{ github.repository }}" |
121 | | - version "${{ needs.release.outputs.version }}" |
122 | | - license "Apache-2.0" |
123 | | -
|
124 | | - on_macos do |
125 | | - on_arm do |
126 | | - url "https://github.com/${{ github.repository }}/releases/download/${TAG}/dmr-darwin-arm64.tar.gz" |
127 | | - sha256 "${{ steps.sha.outputs.darwin_arm64 }}" |
128 | | - end |
129 | | - end |
130 | | -
|
131 | | - on_linux do |
132 | | - on_intel do |
133 | | - url "https://github.com/${{ github.repository }}/releases/download/${TAG}/dmr-linux-amd64.tar.gz" |
134 | | - sha256 "${{ steps.sha.outputs.linux_amd64 }}" |
135 | | - end |
136 | | - on_arm do |
137 | | - url "https://github.com/${{ github.repository }}/releases/download/${TAG}/dmr-linux-arm64.tar.gz" |
138 | | - sha256 "${{ steps.sha.outputs.linux_arm64 }}" |
139 | | - end |
140 | | - end |
141 | | -
|
142 | | - def install |
143 | | - bin.install "dmr" |
144 | | - end |
145 | | -
|
146 | | - test do |
147 | | - assert_match version.to_s, shell_output("#{bin}/dmr version") |
148 | | - end |
149 | | - end |
150 | | - RUBY |
151 | | -
|
152 | | - - name: Open pull request against docker/homebrew-tap |
| 108 | + - name: Dispatch release-dmr.yml in docker/inference-engine-llama.cpp |
153 | 109 | env: |
154 | | - GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} |
| 110 | + # Fine-grained token with Actions: write on |
| 111 | + # docker/inference-engine-llama.cpp. That internal repo owns the |
| 112 | + # code-signing credentials; this public repo cannot hold them, so we |
| 113 | + # only need permission to start its workflow. The signing workflow |
| 114 | + # then signs the macOS/Windows archives, re-uploads them to this |
| 115 | + # release, and opens the Homebrew cask PR. |
| 116 | + GH_TOKEN: ${{ secrets.DMR_SIGN_TRIGGER_TOKEN }} |
155 | 117 | run: | |
156 | 118 | set -euo pipefail |
157 | | - branch="dmr-${{ needs.release.outputs.version }}" |
158 | | - gh repo clone docker/homebrew-tap tap -- --depth=1 |
159 | | - cp formula/dmr.rb tap/Formula/dmr.rb |
160 | | - cd tap |
161 | | - git checkout -b "$branch" |
162 | | - git -c user.name="docker-tools-robot" -c user.email="docker-tools-robot@users.noreply.github.com" \ |
163 | | - commit -am "dmr ${{ needs.release.outputs.version }}" |
164 | | - git push origin "$branch" |
165 | | - gh pr create --repo docker/homebrew-tap \ |
166 | | - --title "dmr ${{ needs.release.outputs.version }}" \ |
167 | | - --body "Automated formula update for dmr ${{ needs.release.outputs.version }}." |
| 119 | + gh workflow run release-dmr.yml \ |
| 120 | + --repo docker/inference-engine-llama.cpp \ |
| 121 | + --ref main \ |
| 122 | + -f tag="$TAG" |
168 | 123 |
|
169 | 124 | publish-winget: |
170 | 125 | name: Publish WinGet manifest |
|
0 commit comments