diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3a37ffd5..7102cab9 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -16,7 +16,7 @@ jobs: # This should work with only the `include`s but it currently doesn't because of this bug: # https://github.community/t5/How-to-use-Git-and-GitHub/GitHub-Actions-Matrix-options-dont-work-as-documented/td-p/29558 target: - - x86_64-osx + - x86_64-apple-darwin - x86_64-unknown-linux-musl - x86_64-pc-windows-gnu - armv7-unknown-linux-musleabihf @@ -25,7 +25,7 @@ jobs: - aarch64-apple-ios include: - os: macos-latest - target: x86_64-osx + target: x86_64-apple-darwin - os: ubuntu-latest target: x86_64-unknown-linux-musl - os: ubuntu-latest @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v1 - name: Build id: build - run: scripts/action release ${{ matrix.target }} + run: scripts/release ${{ matrix.target }} - name: Get the version id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} diff --git a/scripts/brew b/scripts/brew index 2b7a23bb..ca570b06 100755 --- a/scripts/brew +++ b/scripts/brew @@ -14,8 +14,8 @@ gen_formula() { sha_linux="$(sha_for_asset_on_github "$version" "x86_64-unknown-linux-musl")" header "$sha_linux" - header "sha_for x86_64-osx..." - sha_osx="$(sha_for_asset_on_github "$version" "x86_64-osx")" + header "sha_for x86_64-apple-darwin..." + sha_osx="$(sha_for_asset_on_github "$version" "x86_64-apple-darwin")" header "$sha_osx" header "rb..." diff --git a/scripts/docker b/scripts/docker index ba685246..7b7d8826 100755 --- a/scripts/docker +++ b/scripts/docker @@ -5,7 +5,7 @@ export NAVI_HOME="$(cd "$(dirname "$0")/.." && pwd)" cd "$NAVI_HOME" -./scripts/action release x86_64-unknown-linux-musl +./scripts/release x86_64-unknown-linux-musl docker run \ -e HOMEBREW_NO_AUTO_UPDATE=1 \ diff --git a/scripts/install b/scripts/install index ed56b289..67988d0c 100755 --- a/scripts/install +++ b/scripts/install @@ -214,7 +214,7 @@ get_target() { local target case "$archi" in - Darwin*) target="x86_64-osx" ;; + Darwin*) target="x86_64-apple-darwin" ;; *x86*) $is_android && target="" || target="x86_64-unknown-linux-musl" ;; *aarch*) $is_android && target="aarch64-linux-android" || target="armv7-unknown-linux-musleabihf" ;; *arm*) $is_android && target="armv7-linux-androideabi" || target="armv7-unknown-linux-musleabihf" ;; diff --git a/scripts/action b/scripts/release similarity index 84% rename from scripts/action rename to scripts/release index 89c39303..0fdb242c 100755 --- a/scripts/action +++ b/scripts/release @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -##? action release +##? release export NAVI_HOME="$(cd "$(dirname "$0")/.." && pwd)" source "${NAVI_HOME}/scripts/install" @@ -22,19 +22,13 @@ get_env_target() { fi } -as_cross_target() { - echo "$1" | sed "s/osx/apple-darwin/g" -} - _tap() { echoerr "$@" "$@" } release() { - local -r target="${1:-}" - echoerr "target: $target" - local -r cross_target="$(as_cross_target "$target")" + local -r cross_target="${1:-}" echoerr "cross_target: $cross_target" TAR_DIR="${NAVI_HOME}/target/tar" @@ -63,7 +57,7 @@ release() { _ls "${bin_folder}" - if is_windows "$target"; then + if is_windows "$cross_target"; then local -r exe_ext=".exe" use_zip=true else @@ -97,10 +91,4 @@ _ls() { ls -la "$@" || true } -cmd="$1" -shift - -case "$cmd" in - "release") release "$@" ;; - *) exit 2 ;; -esac +release "$@"