Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for linux aarch64 #208

Merged
merged 6 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[alias]
lint = "clippy -- -D warnings"
r = "run"
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,21 @@ jobs:
- name: Build release
run: cargo build --release --locked

- name: Run cargo test
run: cargo test --locked

- name: Build release(aarch64-apple-darwin)
if: startsWith(matrix.os, 'macOS')
run: |
rustup target add aarch64-apple-darwin
cargo build --release --target aarch64-apple-darwin --locked

- name: Run cargo test
run: cargo test --locked
- name: Build release(aarch64-unknown-linux-gnu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update && sudo apt-get install -y crossbuild-essential-arm64
rustup target add aarch64-unknown-linux-gnu
cargo build --release --target aarch64-unknown-linux-gnu --locked

- name: Test install from local file (bash)
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macOS')
Expand All @@ -85,12 +92,17 @@ jobs:
run: zip -r dvm-x86_64-unknown-linux-gnu.zip dvm
working-directory: target/release

- name: Pre-release (linux-aarch64)
if: startsWith(matrix.os, 'ubuntu')
run: zip -r dvm-aarch64-unknown-linux-gnu.zip dvm
working-directory: target/aarch64-unknown-linux-gnu/release

- name: Pre-release (mac)
if: startsWith(matrix.os, 'macOS')
run: zip -r dvm-x86_64-apple-darwin.zip dvm
working-directory: target/release

- name: Pre-release (mac-aarch64)
- name: Pre-release (aarch64-apple-darwin)
if: startsWith(matrix.os, 'macOS')
run: zip -r dvm-aarch64-apple-darwin.zip dvm
working-directory: target/aarch64-apple-darwin/release
Expand All @@ -113,6 +125,7 @@ jobs:
target/release/dvm-x86_64-unknown-linux-gnu.zip
target/release/dvm-x86_64-apple-darwin.zip
target/aarch64-apple-darwin/release/dvm-aarch64-apple-darwin.zip
target/aarch64-unknown-linux-gnu/release/dvm-aarch64-unknown-linux-gnu.zip
draft: true

- name: Release DVM
Expand All @@ -128,7 +141,7 @@ jobs:
target/release/dvm-x86_64-unknown-linux-gnu.zip
target/release/dvm-x86_64-apple-darwin.zip

- name: Release DVM(aarch64)
- name: Release DVM(aarch64-apple-darwin)
uses: justjavac/action-dvm-release@v1
if: |
startsWith(github.repository, 'justjavac') &&
Expand All @@ -139,6 +152,17 @@ jobs:
files: |
target/aarch64-apple-darwin/release/dvm-aarch64-apple-darwin.zip

- name: Release DVM(aarch64-unknown-linux-gnu)
uses: justjavac/action-dvm-release@v1
if: |
startsWith(github.repository, 'justjavac') &&
startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
with:
files: |
target/aarch64-unknown-linux-gnu/release/dvm-aarch64-unknown-linux-gnu.zip

- name: Publish
if: |
startsWith(matrix.os, 'ubuntu') &&
Expand Down
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ else
"Darwin x86_64") target="x86_64-apple-darwin" ;;
"Darwin arm64") target="aarch64-apple-darwin" ;;
"Linux x86_64") target="x86_64-unknown-linux-gnu" ;;
"Linux aarch64") target="aarch64-unknown-linux-gnu.zip" ;;
*) echo "Unsupported OS + CPU combination: $(uname -sm)"; exit 1 ;;
esac
fi
Expand Down
4 changes: 3 additions & 1 deletion src/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ cfg_if! {
const ARCHIVE_NAME: &str = "deno-aarch64-apple-darwin.zip";
} else if #[cfg(all(target_os = "macos", target_arch = "x86_64"))] {
const ARCHIVE_NAME: &str = "deno-x86_64-apple-darwin.zip";
} else if #[cfg(target_os = "linux")] {
} else if #[cfg(all(target_os = "linux", target_arch = "x86_64"))] {
const ARCHIVE_NAME: &str = "deno-x86_64-unknown-linux-gnu.zip";
} else if #[cfg(all(target_os = "linux", target_arch = "aarch64"))] {
const ARCHIVE_NAME: &str = "deno-aarch64-unknown-linux-gnu.zip";
}
}

Expand Down
Loading