Release builds of oh for Linux, macOS and Windows 99ca93d60bca
scripts/dist.sh cross-compiles oh as oxygen's does oxy: .tar.gz archives for Linux x86_64/arm64 (glibc 2.28 and later) and macOS x86_64/arm64, a .zip for Windows x86_64, .deb packages for amd64 and arm64, and SHA256SUMS, each archive with the README, LICENSE and docs/oh.md. The README says how to install oh. The licence is now in LICENSE. closes #65
- Author
- Andy McCall @andymccall <[email protected]>
- When
- · 2026-09-30 18:52 UTC
- Signature
- ✔ signed by Andy McCall
- Hash
99ca93d60bca1c23c79d5cdf35bdab6d4c6197831417f512ef58748e22ed87d2- Depends on
- d23464c0ac60
- Depended on by
- 806615f974c0 93f445fa50d8 7c572789349b 5d66f27cebe2 166f6e9bf4f1 b9eb70fb9509 e15409084ed6 73beb84b202a c33dbd9a0d38 913e5ad27b17 a7c05940ebc4 f2c9757605c1 c2732e07323b
- In bookmarks
- api-unknown-fields cancel-landed-runs clear-waiting close-proposal-140 diffusion-pin-bookmark draft-ready image-check job-waits main oh-comment-body-file proposal-list-fast run-one-job wiki-says-so
- In tags
- v0.1.0 v0.2.0 v0.3.0 v0.3.1 v0.4.0 v0.4.1 v0.4.2 v0.5.0 v0.5.1 v0.5.2 v0.6.0 v0.6.1 v0.7.0 v0.8.0 v0.9.0 v0.9.1 v0.9.11 v0.9.15 v0.9.16 v0.9.19 v0.9.2 v0.9.20 v0.9.21 v0.9.22 v0.9.23 v0.9.24 v0.9.3 v0.9.4 v0.9.5 v0.9.6 v0.9.7 v0.9.8 v0.9.9
- Edits
- 3 atoms, 3 tree operations, 3 files
Browse the tree at this change
added LICENSE +30 −0
| 1 | + | OxygenHub (the hub, oh and hub-api) is licensed under either of |
|
| 2 | + | ||
| 3 | + | * the MIT License (below), or |
|
| 4 | + | * the Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0) |
|
| 5 | + | ||
| 6 | + | at your option. |
|
| 7 | + | ||
| 8 | + | --- |
|
| 9 | + | ||
| 10 | + | MIT License |
|
| 11 | + | ||
| 12 | + | Copyright (c) 2026 Andy McCall |
|
| 13 | + | ||
| 14 | + | Permission is hereby granted, free of charge, to any person obtaining a copy |
|
| 15 | + | of this software and associated documentation files (the "Software"), to deal |
|
| 16 | + | in the Software without restriction, including without limitation the rights |
|
| 17 | + | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
| 18 | + | copies of the Software, and to permit persons to whom the Software is |
|
| 19 | + | furnished to do so, subject to the following conditions: |
|
| 20 | + | ||
| 21 | + | The above copyright notice and this permission notice shall be included in all |
|
| 22 | + | copies or substantial portions of the Software. |
|
| 23 | + | ||
| 24 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
| 25 | + | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
| 26 | + | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
| 27 | + | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
| 28 | + | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
| 29 | + | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
| 30 | + | SOFTWARE. |
added scripts/dist.sh +95 −0
| 1 | + | #!/usr/bin/env bash |
|
| 2 | + | # Build release archives of one binary for every platform from Linux: |
|
| 3 | + | # Linux x86_64 and arm64 (glibc 2.28 and later): .tar.gz and .deb |
|
| 4 | + | # macOS x86_64 and arm64: .tar.gz |
|
| 5 | + | # Windows x86_64: .zip |
|
| 6 | + | # plus SHA256SUMS, in target/dist/VERSION. |
|
| 7 | + | # |
|
| 8 | + | # scripts/dist.sh [VERSION] (default: the package version) |
|
| 9 | + | # |
|
| 10 | + | # Needs: rustup targets x86_64-pc-windows-gnu, aarch64-unknown-linux-gnu, |
|
| 11 | + | # x86_64-apple-darwin and aarch64-apple-darwin; cargo-zigbuild and zig on |
|
| 12 | + | # PATH (Linux with an old glibc, and macOS without Apple's SDK); the |
|
| 13 | + | # MinGW-w64 gcc (Windows); dpkg-deb and zip. |
|
| 14 | + | set -euo pipefail |
|
| 15 | + | ||
| 16 | + | PKG=oh # the cargo package |
|
| 17 | + | BIN=oh # the binary it builds |
|
| 18 | + | DEB_NAME=oh # the Debian package |
|
| 19 | + | SUMMARY="OxygenHub from the command line" |
|
| 20 | + | DESCRIPTION="oh talks to an OxygenHub (such as https://oxygenhub.io): issues, |
|
| 21 | + | proposals and their reviews, releases, Flow runs and checks, from the |
|
| 22 | + | terminal. It works alongside oxy, the Oxygen version control client." |
|
| 23 | + | HOMEPAGE="https://oxygenhub.io/andymccall/oxygenhub" |
|
| 24 | + | MAINTAINER="Andy McCall <[email protected]>" |
|
| 25 | + | DOCS=(README.md LICENSE docs/oh.md) |
|
| 26 | + | ||
| 27 | + | cd "$(dirname "$0")/.." |
|
| 28 | + | VERSION="${1:-$(cargo metadata --no-deps --format-version 1 | python3 -c "import json,sys; print(next(p['version'] for p in json.load(sys.stdin)['packages'] if p['name']=='$PKG'))")}" |
|
| 29 | + | VERSION="${VERSION#v}" |
|
| 30 | + | OUT="target/dist/$VERSION" |
|
| 31 | + | rm -rf "$OUT" && mkdir -p "$OUT" |
|
| 32 | + | export PATH="$HOME/.local/opt/zig:$PATH" |
|
| 33 | + | # Stripped, with no debug info: these are for people, not for debugging. |
|
| 34 | + | export CARGO_PROFILE_RELEASE_DEBUG=0 CARGO_PROFILE_RELEASE_STRIP=true CARGO_INCREMENTAL=0 |
|
| 35 | + | # The version the binary reports. |
|
| 36 | + | export OXY_BUILD="v$VERSION" |
|
| 37 | + | ||
| 38 | + | # target triple | platform name | build tool | Debian architecture |
|
| 39 | + | PLATFORMS=( |
|
| 40 | + | "x86_64-unknown-linux-gnu.2.28|linux-x86_64|zig|amd64" |
|
| 41 | + | "aarch64-unknown-linux-gnu.2.28|linux-arm64|zig|arm64" |
|
| 42 | + | "x86_64-apple-darwin|macos-x86_64|zig|" |
|
| 43 | + | "aarch64-apple-darwin|macos-arm64|zig|" |
|
| 44 | + | "x86_64-pc-windows-gnu|windows-x86_64|cargo|" |
|
| 45 | + | ) |
|
| 46 | + | ||
| 47 | + | for p in "${PLATFORMS[@]}"; do |
|
| 48 | + | IFS='|' read -r target platform tool deb <<<"$p" |
|
| 49 | + | triple="${target%%.2.*}" |
|
| 50 | + | echo "== $platform ($target)" |
|
| 51 | + | if [ "$tool" = zig ]; then |
|
| 52 | + | cargo zigbuild -q --release --locked --target "$target" -p "$PKG" |
|
| 53 | + | else |
|
| 54 | + | cargo build -q --release --locked --target "$target" -p "$PKG" |
|
| 55 | + | fi |
|
| 56 | + | exe="$BIN" |
|
| 57 | + | [[ "$triple" == *windows* ]] && exe="$BIN.exe" |
|
| 58 | + | built="target/$triple/release/$exe" |
|
| 59 | + | name="$BIN-$VERSION-$platform" |
|
| 60 | + | stage="$OUT/stage/$name" |
|
| 61 | + | mkdir -p "$stage" |
|
| 62 | + | cp "$built" "$stage/" |
|
| 63 | + | cp "${DOCS[@]}" "$stage/" |
|
| 64 | + | if [[ "$triple" == *windows* ]]; then |
|
| 65 | + | (cd "$OUT/stage" && zip -qr "../$name.zip" "$name") |
|
| 66 | + | else |
|
| 67 | + | tar -C "$OUT/stage" -czf "$OUT/$name.tar.gz" "$name" |
|
| 68 | + | fi |
|
| 69 | + | if [ -n "$deb" ]; then |
|
| 70 | + | root="$OUT/stage/deb-$deb" |
|
| 71 | + | mkdir -p "$root/DEBIAN" "$root/usr/bin" "$root/usr/share/doc/$DEB_NAME" |
|
| 72 | + | install -m 0755 "$built" "$root/usr/bin/$BIN" |
|
| 73 | + | cp README.md docs/oh.md "$root/usr/share/doc/$DEB_NAME/" |
|
| 74 | + | cp LICENSE "$root/usr/share/doc/$DEB_NAME/copyright" |
|
| 75 | + | cat >"$root/DEBIAN/control" <<EOF |
|
| 76 | + | Package: $DEB_NAME |
|
| 77 | + | Version: $VERSION |
|
| 78 | + | Architecture: $deb |
|
| 79 | + | Maintainer: $MAINTAINER |
|
| 80 | + | Depends: libc6 (>= 2.28) |
|
| 81 | + | Section: vcs |
|
| 82 | + | Priority: optional |
|
| 83 | + | Homepage: $HOMEPAGE |
|
| 84 | + | Installed-Size: $(du -sk "$root/usr" | cut -f1) |
|
| 85 | + | Description: $SUMMARY |
|
| 86 | + | $DESCRIPTION |
|
| 87 | + | EOF |
|
| 88 | + | dpkg-deb --build --root-owner-group -Zxz "$root" "$OUT/${DEB_NAME}_${VERSION}_$deb.deb" >/dev/null |
|
| 89 | + | fi |
|
| 90 | + | done |
|
| 91 | + | ||
| 92 | + | rm -rf "$OUT/stage" |
|
| 93 | + | (cd "$OUT" && sha256sum -- *.tar.gz *.zip *.deb >SHA256SUMS) |
|
| 94 | + | echo "== $OUT" |
|
| 95 | + | ls -l "$OUT" |
modified README.md +13 −0
| … | 14 unchanged lines |
||
| 15 | 15 | conflicts, the trust policy and the push log. Accounts, proposals, issues |
|
| 16 | 16 | and the rest follow the milestones in the specification. |
|
| 17 | 17 | ||
| 18 | + | ## Install oh |
|
| 19 | + | ||
| 20 | + | Builds for Linux, macOS and Windows are on the [releases page](https://oxygenhub.io/andymccall/oxygenhub/releases). These are early releases: the macOS and Windows builds are not signed and have had little testing. |
|
| 21 | + | ||
| 22 | + | - **Debian, Ubuntu and other Linux with apt** (x86_64 or arm64): download `oh_VERSION_amd64.deb` (or `_arm64.deb`) and run `sudo apt install ./oh_VERSION_amd64.deb`. It needs glibc 2.28 or later (Debian 10, Ubuntu 20.04 and newer). |
|
| 23 | + | - **Other Linux:** unpack `oh-VERSION-linux-x86_64.tar.gz` (or `-linux-arm64`) and put `oh` on your `PATH`. |
|
| 24 | + | - **macOS** (Apple Silicon or Intel): unpack `oh-VERSION-macos-arm64.tar.gz` (or `-macos-x86_64`), then `xattr -d com.apple.quarantine oh`, since the build is not notarised, and put it on your `PATH`. |
|
| 25 | + | - **Windows:** unzip `oh-VERSION-windows-x86_64.zip` and put the folder on your `PATH`. SmartScreen may warn on first run, since the build is not signed. |
|
| 26 | + | ||
| 27 | + | Sign in with `oh auth login --with-hub https://oxygenhub.io`; the commands are in `docs/oh.md`. `oh` works alongside `oxy`, from [Oxygen's releases](https://oxygenhub.io/andymccall/oxygen/releases). |
|
| 28 | + | ||
| 29 | + | Check a download against the release's `SHA256SUMS` with `sha256sum -c SHA256SUMS --ignore-missing`. |
|
| 30 | + | ||
| 18 | 31 | ## Running |
|
| 19 | 32 | ||
| 20 | 33 | ``` |
|
| … | 30 unchanged lines |