| 99ca93d6 Andy McCall ↶ | 1 | #!/usr/bin/env bash |
| 2 | # Build release archives of one binary for every platform from Linux: |
|
| c2732e07 Andy McCall ↶ | 3 | # Linux x86_64, arm64 and riscv64 (glibc 2.28 and later): .tar.gz and .deb |
| 99ca93d6 Andy McCall ↶ | 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, |
|
| c2732e07 Andy McCall ↶ | 11 | # riscv64gc-unknown-linux-gnu, |
| 99ca93d6 Andy McCall ↶ | 12 | # x86_64-apple-darwin and aarch64-apple-darwin; cargo-zigbuild and zig on |
| 13 | # PATH (Linux with an old glibc, and macOS without Apple's SDK); the |
|
| 14 | # MinGW-w64 gcc (Windows); dpkg-deb and zip. |
|
| 15 | |
|
| 16 | ||
| 17 | PKG=oh # the cargo package |
|
| 18 | BIN=oh # the binary it builds |
|
| 19 | DEB_NAME=oh # the Debian package |
|
| 20 | SUMMARY="OxygenHub from the command line" |
|
| 21 | DESCRIPTION="oh talks to an OxygenHub (such as https://oxygenhub.io): issues, |
|
| 22 | proposals and their reviews, releases, Flow runs and checks, from the |
|
| 23 | terminal. It works alongside oxy, the Oxygen version control client." |
|
| 24 | HOMEPAGE="https://oxygenhub.io/andymccall/oxygenhub" |
|
| 25 | MAINTAINER="Andy McCall <[email protected]>" |
|
| 26 | DOCS=(README.md LICENSE docs/oh.md) |
|
| 27 | ||
| 28 | |
|
| 29 | VERSION="" |
|
| 30 | VERSION="" |
|
| 31 | OUT="target/dist/" |
|
| 32 | && |
|
| 33 | |
|
| 34 | # Stripped, with no debug info: these are for people, not for debugging. |
|
| 35 | |
|
| 36 | # The version the binary reports. |
|
| 37 | |
|
| 38 | ||
| 39 | # target triple | platform name | build tool | Debian architecture |
|
| 40 | PLATFORMS=( |
|
| 41 | "x86_64-unknown-linux-gnu.2.28|linux-x86_64|zig|amd64" |
|
| 42 | "aarch64-unknown-linux-gnu.2.28|linux-arm64|zig|arm64" |
|
| c2732e07 Andy McCall ↶ | 43 | "riscv64gc-unknown-linux-gnu.2.28|linux-riscv64|zig|riscv64" |
| 99ca93d6 Andy McCall ↶ | 44 | "x86_64-apple-darwin|macos-x86_64|zig|" |
| 45 | "aarch64-apple-darwin|macos-arm64|zig|" |
|
| 46 | "x86_64-pc-windows-gnu|windows-x86_64|cargo|" |
|
| 47 | ) |
|
| 48 | ||
| 49 | for; do |
|
| 50 | IFS='|' |
|
| 51 | triple="" |
|
| 52 | |
|
| 53 | if [; then |
|
| 54 | |
|
| 55 | else |
|
| 56 | |
|
| 57 | fi |
|
| 58 | exe="" |
|
| 59 | && exe=".exe" |
|
| 60 | built="target//release/" |
|
| 61 | name="--" |
|
| 62 | stage="/stage/" |
|
| 63 | |
|
| 64 | |
|
| 65 | |
|
| 66 | if ; then |
|
| 67 | ( && ) |
|
| 68 | else |
|
| 69 | |
|
| 70 | fi |
|
| 71 | if [; then |
|
| 72 | root="/stage/deb-" |
|
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
|
| 82 | |
|
| 83 | |
|
| 84 | |
|
| 85 | |
|
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | fi |
|
| 92 | done |
|
| 93 | ||
| 94 | |
|
| 95 | ( && ) |
|
| 96 | |
|
| 97 | |