aarch64-apple-darwin release script fix

This commit is contained in:
zonyitoo
2021-09-29 12:21:19 +08:00
parent 1c14bc9855
commit 3d6e4dd5a4
4 changed files with 28 additions and 10 deletions

View File

@@ -52,9 +52,10 @@ jobs:
RUST_BACKTRACE: full
strategy:
matrix:
include:
- os: macos-latest
target: macos-native
os: [macos-latest]
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
steps:
- uses: actions/checkout@v2
@@ -69,12 +70,21 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: ${{ matrix.target }}
default: true
# https://github.com/actions/virtual-environments/issues/2557#issuecomment-769611326
- if: ${{ matrix.target }} == 'aarch64-apple-darwin'
run: |
sudo xcode-select -s /Applications/Xcode_12.4.app &&
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
- name: Build release
shell: bash
run: |
cd build
./build-host-release
./build-host-release -t ${{ matrix.target }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
@@ -94,6 +104,8 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
default: true
- name: Build release
run: |

View File

@@ -87,9 +87,10 @@ jobs:
profile: minimal
toolchain: nightly
target: ${{ matrix.target }}
default: true
# https://github.com/actions/virtual-environments/issues/2557#issuecomment-769611326
- if: ${{ matrix.target }} == 'aarch-apple-darwin'
- if: ${{ matrix.target }} == 'aarch64-apple-darwin'
run: |
sudo xcode-select -s /Applications/Xcode_12.4.app &&
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*
@@ -121,6 +122,7 @@ jobs:
with:
profile: minimal
toolchain: nightly
default: true
- name: Build release
run: |

2
Cargo.lock generated
View File

@@ -1592,7 +1592,7 @@ dependencies = [
[[package]]
name = "shadowsocks-rust"
version = "1.12.0-alpha.6"
version = "1.12.0-alpha.7"
dependencies = [
"build-time",
"byte_string",

View File

@@ -22,7 +22,7 @@ ROOT_DIR=$( cd $( dirname $0 ) && pwd )
VERSION=$(grep -E '^version' "${ROOT_DIR}/../Cargo.toml" | awk '{print $3}' | sed 's/"//g')
HOST_TRIPLE=$(rustc -Vv | grep 'host:' | awk '{print $2}')
echo "Started build release ${VERSION} for ${HOST_TRIPLE} with features \"${BUILD_FEATURES}\"..."
echo "Started build release ${VERSION} for ${HOST_TRIPLE} (target: ${BUILD_TARGET}) with features \"${BUILD_FEATURES}\"..."
if [[ "${BUILD_TARGET}" != "" ]]; then
if [[ "${BUILD_FEATURES}" != "" ]]; then
@@ -42,15 +42,19 @@ if [[ "$?" != "0" ]]; then
exit $?;
fi
if [[ "${BUILD_TARGET}" == "" ]]; then
BUILD_TARGET=$HOST_TRIPLE
fi
TARGET_SUFFIX=""
if [[ "${HOST_TRIPLE}" == *"-windows-"* ]]; then
if [[ "${BUILD_TARGET}" == *"-windows-"* ]]; then
TARGET_SUFFIX=".exe"
fi
TARGETS=("sslocal${TARGET_SUFFIX}" "ssserver${TARGET_SUFFIX}" "ssurl${TARGET_SUFFIX}" "ssmanager${TARGET_SUFFIX}")
RELEASE_FOLDER="${ROOT_DIR}/release"
RELEASE_PACKAGE_NAME="shadowsocks-v${VERSION}.${HOST_TRIPLE}"
RELEASE_PACKAGE_NAME="shadowsocks-v${VERSION}.${BUILD_TARGET}"
mkdir -p "${RELEASE_FOLDER}"
@@ -61,7 +65,7 @@ else
cd "${ROOT_DIR}/../target/release"
fi
if [[ "${HOST_TRIPLE}" == *"-windows-"* ]]; then
if [[ "${BUILD_TARGET}" == *"-windows-"* ]]; then
# For Windows, use zip
RELEASE_PACKAGE_FILE_NAME="${RELEASE_PACKAGE_NAME}.zip"