mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 13:15:21 +00:00
Merge pull request #101 from lj3954/build_aarch64
feat: Build aarch64 binaries
This commit is contained in:
commit
938ce3f7c7
8
.github/workflows/linutil.yml
vendored
8
.github/workflows/linutil.yml
vendored
|
@ -33,10 +33,14 @@ jobs:
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
targets: x86_64-unknown-linux-musl
|
targets: x86_64-unknown-linux-musl
|
||||||
- name: Build
|
- name: Install cross-rs for cross-compilation
|
||||||
|
run: cargo install cross
|
||||||
|
- name: Build x86_64 binary
|
||||||
run: cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl
|
run: cargo build --target-dir=build --release --verbose --target=x86_64-unknown-linux-musl
|
||||||
|
- name: Build aarch64 binary
|
||||||
|
run: cross build --target-dir=build --release --verbose --target=aarch64-unknown-linux-musl
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: Commit Linutil
|
commit_message: Commit Linutil
|
||||||
file_pattern: "build/x86_64-unknown-linux-musl/release/linutil"
|
file_pattern: "build/x86_64-unknown-linux-musl/release/linutil build/aarch64-unknown-linux-musl/release/linutil"
|
||||||
if: success()
|
if: success()
|
||||||
|
|
4
.github/workflows/pre-release.yaml
vendored
4
.github/workflows/pre-release.yaml
vendored
|
@ -21,6 +21,9 @@ jobs:
|
||||||
echo "version=$version" >> $GITHUB_ENV
|
echo "version=$version" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Rename aarch64 binary for release
|
||||||
|
run: mv ./build/aarch64-unknown-linux-musl/release/linutil ./build/aarch64-unknown-linux-musl/release/linutil-aarch64
|
||||||
|
|
||||||
- name: Create and Upload Release
|
- name: Create and Upload Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
@ -31,6 +34,7 @@ jobs:
|
||||||
append_body: false
|
append_body: false
|
||||||
files: |
|
files: |
|
||||||
./build/x86_64-unknown-linux-musl/release/linutil
|
./build/x86_64-unknown-linux-musl/release/linutil
|
||||||
|
./build/aarch64-unknown-linux-musl/release/linutil-aarch64
|
||||||
prerelease: true
|
prerelease: true
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
env:
|
env:
|
||||||
|
|
20
start.sh
20
start.sh
|
@ -3,8 +3,6 @@
|
||||||
rc='\033[0m'
|
rc='\033[0m'
|
||||||
red='\033[0;31m'
|
red='\033[0;31m'
|
||||||
|
|
||||||
binary_url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
|
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
exit_code=$1
|
exit_code=$1
|
||||||
message=$2
|
message=$2
|
||||||
|
@ -18,10 +16,26 @@ check() {
|
||||||
unset message
|
unset message
|
||||||
}
|
}
|
||||||
|
|
||||||
|
findArch() {
|
||||||
|
case "$(uname -m)" in
|
||||||
|
x86_64|amd64) arch="x86_64" ;;
|
||||||
|
aarch64|arm64) arch="aarch64" ;;
|
||||||
|
*) check 1 "Unsupported architecture"
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
getUrl() {
|
||||||
|
case "${arch}" in
|
||||||
|
x86_64) echo "https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil";;
|
||||||
|
*) echo "https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil-${arch}";;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
findArch
|
||||||
temp_file=$(mktemp)
|
temp_file=$(mktemp)
|
||||||
check $? "Creating the temporary file"
|
check $? "Creating the temporary file"
|
||||||
|
|
||||||
curl -fsL "$binary_url" -o "$temp_file"
|
curl -fsL "$(getUrl)" -o "$temp_file"
|
||||||
check $? "Downloading linutil"
|
check $? "Downloading linutil"
|
||||||
|
|
||||||
chmod +x "$temp_file"
|
chmod +x "$temp_file"
|
||||||
|
|
17
startdev.sh
17
startdev.sh
|
@ -24,6 +24,7 @@ redirect_to_latest_pre_release() {
|
||||||
echo "Using latest Full Release"
|
echo "Using latest Full Release"
|
||||||
url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
|
url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
|
||||||
fi
|
fi
|
||||||
|
addArch
|
||||||
echo "Using URL: $url" # Log the URL being used
|
echo "Using URL: $url" # Log the URL being used
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +38,22 @@ check() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addArch() {
|
||||||
|
case "${arch}" in
|
||||||
|
x86_64);;
|
||||||
|
*) url="${url}-${arch}";;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
findArch() {
|
||||||
|
case "$(uname -m)" in
|
||||||
|
x86_64|amd64) arch="x86_64" ;;
|
||||||
|
aarch64|arm64) arch="aarch64" ;;
|
||||||
|
*) check 1 "Unsupported architecture"
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
findArch
|
||||||
redirect_to_latest_pre_release
|
redirect_to_latest_pre_release
|
||||||
|
|
||||||
TMPFILE=$(mktemp)
|
TMPFILE=$(mktemp)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user