@@ -60,33 +60,17 @@ jobs:
6060 sudo apt-get install -y --no-install-recommends \
6161 pkg-config libssl-dev build-essential
6262
63- - name : Build CLI binary
64- run : cargo build --release --bin openhuman-core
65- env :
66- OPENHUMAN_SENTRY_DSN : ${{ vars.OPENHUMAN_SENTRY_DSN }}
67-
68- - name : Package tarball and upload to release
63+ - name : Build CLI binary and package tarball
6964 env :
7065 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66+ OPENHUMAN_SENTRY_DSN : ${{ vars.OPENHUMAN_SENTRY_DSN }}
7167 run : |
72- set -euo pipefail
68+ cargo build --release --bin openhuman-core
7369 VERSION="${{ github.event.release.tag_name }}"
74- VERSION="${VERSION#v}"
75- TARGET="aarch64-unknown-linux-gnu"
76- TARBALL="openhuman-core-${VERSION}-${TARGET}.tar.gz"
77-
78- WORK=$(mktemp -d)
79- trap 'rm -rf "$WORK"' EXIT
80- cp target/release/openhuman-core "$WORK/"
81- chmod +x "$WORK/openhuman-core"
82- tar -czf "$TARBALL" -C "$WORK" openhuman-core
83- openssl dgst -sha256 -r "$TARBALL" | awk '{print $1}' > "${TARBALL}.sha256"
84-
85- gh release upload "${{ github.event.release.tag_name }}" \
86- "$TARBALL" "${TARBALL}.sha256" \
87- --repo tinyhumansai/openhuman --clobber
88-
89- echo "[pkg] Uploaded $TARBALL"
70+ bash scripts/release/package-cli-tarball.sh \
71+ target/release/openhuman-core \
72+ "${VERSION#v}" \
73+ aarch64-unknown-linux-gnu
9074
9175 # ────────────────────────────────────────────────────────────────────────────
9276 # 2. Update Homebrew tap
@@ -111,55 +95,14 @@ jobs:
11195 token : ${{ secrets.HOMEBREW_TAP_TOKEN }}
11296 path : tap
11397
114- - name : Download tarballs and compute checksums
98+ - name : Update Homebrew formula
11599 env :
116100 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
117101 run : |
118- set -euo pipefail
119- TAG="${{ github.event.release.tag_name }}"
120- VERSION="${TAG#v}"
121- mkdir -p /tmp/tarballs
122-
123- for row in \
124- "aarch64-apple-darwin:SHA256_MACOS_ARM64" \
125- "x86_64-apple-darwin:SHA256_MACOS_X64" \
126- "x86_64-unknown-linux-gnu:SHA256_LINUX_X64" \
127- "aarch64-unknown-linux-gnu:SHA256_LINUX_ARM64"
128- do
129- TARGET="${row%%:*}"
130- VAR="${row##*:}"
131- TARBALL="openhuman-core-${VERSION}-${TARGET}.tar.gz"
132- echo "[homebrew] Downloading $TARBALL ..."
133- gh release download "$TAG" \
134- --pattern "$TARBALL" \
135- --repo tinyhumansai/openhuman \
136- --dir /tmp/tarballs
137- SHA=$(openssl dgst -sha256 -r "/tmp/tarballs/$TARBALL" | awk '{print $1}')
138- echo "${VAR}=${SHA}" >> "$GITHUB_ENV"
139- echo "[homebrew] $TARGET → $SHA"
140- done
141- echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
142-
143- - name : Render and commit formula
144- run : |
145- set -euo pipefail
146- mkdir -p tap/Formula
147-
148- sed \
149- -e "s/@VERSION@/${VERSION}/g" \
150- -e "s/@SHA256_MACOS_ARM64@/${SHA256_MACOS_ARM64}/g" \
151- -e "s/@SHA256_MACOS_X64@/${SHA256_MACOS_X64}/g" \
152- -e "s/@SHA256_LINUX_X64@/${SHA256_LINUX_X64}/g" \
153- -e "s/@SHA256_LINUX_ARM64@/${SHA256_LINUX_ARM64}/g" \
154- src/packages/homebrew/openhuman.rb > tap/Formula/openhuman.rb
155-
156- cd tap
157- git config user.name "github-actions[bot]"
158- git config user.email "github-actions[bot]@users.noreply.github.com"
159- git add Formula/openhuman.rb
160- git diff --cached --quiet && echo "[homebrew] No changes to commit." && exit 0
161- git commit -m "chore: update formula to v${VERSION}"
162- git push
102+ bash src/scripts/release/update-homebrew.sh \
103+ "${{ github.event.release.tag_name }}" \
104+ src/packages/homebrew/openhuman.rb \
105+ tap
163106
164107 # ────────────────────────────────────────────────────────────────────────────
165108 # 3. Build Debian apt repository and deploy to GitHub Pages
@@ -191,76 +134,21 @@ jobs:
191134 echo "$APT_SIGNING_KEY" | gpg --batch --import
192135 gpg --list-secret-keys
193136
194- - name : Download Linux CLI tarballs from release
195- env :
196- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
197- run : |
198- set -euo pipefail
199- TAG="${{ github.event.release.tag_name }}"
200- VERSION="${TAG#v}"
201- mkdir -p /tmp/tarballs
202-
203- for target in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu; do
204- TARBALL="openhuman-core-${VERSION}-${target}.tar.gz"
205- gh release download "$TAG" \
206- --pattern "$TARBALL" \
207- --repo tinyhumansai/openhuman \
208- --dir /tmp/tarballs
209- echo "[apt] Downloaded $TARBALL"
210- done
211- echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
212-
213- - name : Extract binaries and build .deb packages
214- run : |
215- set -euo pipefail
216- mkdir -p /tmp/bins
217-
218- tar -xzf "/tmp/tarballs/openhuman-core-${VERSION}-x86_64-unknown-linux-gnu.tar.gz" \
219- -C /tmp/bins
220- mv /tmp/bins/openhuman-core /tmp/bins/openhuman-core-amd64
221-
222- tar -xzf "/tmp/tarballs/openhuman-core-${VERSION}-aarch64-unknown-linux-gnu.tar.gz" \
223- -C /tmp/bins
224- mv /tmp/bins/openhuman-core /tmp/bins/openhuman-core-arm64
225-
226- chmod +x /tmp/bins/openhuman-core-amd64 /tmp/bins/openhuman-core-arm64
227-
228- bash packages/deb/build.sh /tmp/bins/openhuman-core-amd64 "${VERSION}" amd64
229- bash packages/deb/build.sh /tmp/bins/openhuman-core-arm64 "${VERSION}" arm64
230-
231- ls -lh openhuman_*.deb
232-
233- - name : Build apt repository
234- env :
235- APT_SIGNING_KEY_ID : ${{ secrets.APT_SIGNING_KEY_ID }}
236- run : |
237- bash scripts/build-apt-repo.sh /tmp/apt-repo \
238- "openhuman_${VERSION}_amd64.deb" \
239- "openhuman_${VERSION}_arm64.deb"
240-
241137 - name : Checkout gh-pages branch
242138 uses : actions/checkout@v4
243139 with :
244140 ref : gh-pages
245141 path : gh-pages
246- # Create the branch if it doesn't exist
247142 fetch-depth : 0
248143
249- - name : Update apt/ directory on gh-pages
144+ - name : Build .deb packages, apt repo, and deploy to gh-pages
145+ env :
146+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
147+ APT_SIGNING_KEY_ID : ${{ secrets.APT_SIGNING_KEY_ID }}
250148 run : |
251- set -euo pipefail
252- mkdir -p gh-pages/apt
253- # Remove old apt content, replace with freshly built repo
254- rm -rf gh-pages/apt/*
255- cp -r /tmp/apt-repo/. gh-pages/apt/
256-
257- cd gh-pages
258- git config user.name "github-actions[bot]"
259- git config user.email "github-actions[bot]@users.noreply.github.com"
260- git add apt/
261- git diff --cached --quiet && echo "[apt] No changes." && exit 0
262- git commit -m "chore(apt): publish v${VERSION}"
263- git push origin gh-pages
149+ bash scripts/release/build-apt-packages.sh \
150+ "${{ github.event.release.tag_name }}" \
151+ --deploy-gh-pages gh-pages
264152
265153 # ────────────────────────────────────────────────────────────────────────────
266154 # 4. Publish npm package
@@ -285,21 +173,7 @@ jobs:
285173 - name : Set version and publish
286174 env :
287175 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
288- run : |
289- set -euo pipefail
290- VERSION="${{ github.event.release.tag_name }}"
291- VERSION="${VERSION#v}"
292-
293- cd packages/npm
294-
295- # Stamp version without creating a git commit
296- npm version "$VERSION" --no-git-tag-version
297-
298- # SKIP_OPENHUMAN_BINARY_DOWNLOAD prevents postinstall from running
299- # during publish (the binary doesn't exist yet on the publish runner)
300- SKIP_OPENHUMAN_BINARY_DOWNLOAD=1 npm publish --access public
301-
302- echo "[npm] Published openhuman@${VERSION}"
176+ run : bash scripts/release/publish-npm.sh "${{ github.event.release.tag_name }}"
303177
304178 # ────────────────────────────────────────────────────────────────────────────
305179 # 5. Smoke test: Homebrew
0 commit comments