-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for arm64 architecture for both linux and macos (#387)
* init commit for adding arm64 support for both macos, and linux * testing changes to release workflow * testing changes to release workflow * testing changes to release workflow * fix for unique ids * testing changes to release workflow * testing changes to release workflow * testing changes to release workflow * updating install script, and adding fix for failing curl/wget reqs * testing changes to install script * typo * fixing symlink step * testing changes to install script * removing echo * removing testing url, and putting it back to main repo * linting for install script * more lints breaking CI * updating release workflow to run sudo apt update before attempting to install gcc for aarch64 due to transient errors
- Loading branch information
1 parent
c0f15ed
commit 2389367
Showing
2 changed files
with
144 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: Rust | ||
on: | ||
release: | ||
types: [ published ] | ||
types: [published] | ||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
|
@@ -12,39 +12,66 @@ jobs: | |
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: cargo build --verbose --release | ||
- name: Get release | ||
id: get_release | ||
uses: bruceadams/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Package release | ||
id: package | ||
uses: knicknic/[email protected] | ||
with: | ||
macos: | | ||
rustup target add x86_64-apple-darwin | ||
cargo build --release --target x86_64-apple-darwin | ||
mkdir cfn-guard-v3-${{ matrix.os }} | ||
cp ./target/x86_64-apple-darwin/release/cfn-guard ./cfn-guard-v3-${{ matrix.os }}/ | ||
cp README.md ./cfn-guard-v3-${{ matrix.os }}/ | ||
tar czvf ./cfn-guard-v3-${{ matrix.os }}.tar.gz ./cfn-guard-v3-${{ matrix.os }} | ||
linux: | | ||
rustup target add x86_64-unknown-linux-musl | ||
cargo build --release --target x86_64-unknown-linux-musl | ||
mkdir cfn-guard-v3-${{ matrix.os }} | ||
cp ./target/x86_64-unknown-linux-musl/release/cfn-guard ./cfn-guard-v3-${{ matrix.os }}/ | ||
cp README.md ./cfn-guard-v3-${{ matrix.os }}/ | ||
tar czvf ./cfn-guard-v3-${{ matrix.os }}.tar.gz ./cfn-guard-v3-${{ matrix.os }} | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get_release.outputs.upload_url }} | ||
asset_path: ./cfn-guard-v3-${{ matrix.os }}.tar.gz | ||
asset_name: cfn-guard-v3-${{ matrix.os }}.tar.gz | ||
asset_content_type: application/octet-stream | ||
- uses: actions/checkout@v2 | ||
- name: Build | ||
run: cargo build --verbose --release | ||
- name: Get release | ||
id: get_release | ||
uses: bruceadams/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: Package release | ||
id: package | ||
uses: knicknic/[email protected] | ||
with: | ||
macos: | | ||
rustup target add x86_64-apple-darwin | ||
cargo build --release --target x86_64-apple-darwin | ||
mkdir cfn-guard-v3-x86_64-${{ matrix.os }} | ||
cp ./target/x86_64-apple-darwin/release/cfn-guard ./cfn-guard-v3-x86_64-${{ matrix.os }}/ | ||
cp README.md ./cfn-guard-v3-x86_64-${{ matrix.os }}/ | ||
tar czvf ./cfn-guard-v3-x86_64-${{ matrix.os }}.tar.gz ./cfn-guard-v3-x86_64-${{ matrix.os }} | ||
rustup target add aarch64-apple-darwin | ||
cargo build --release --target aarch64-apple-darwin | ||
mkdir cfn-guard-v3-aarch64-${{ matrix.os }} | ||
cp ./target/aarch64-apple-darwin/release/cfn-guard ./cfn-guard-v3-aarch64-${{ matrix.os }}/ | ||
cp README.md ./cfn-guard-v3-aarch64-${{ matrix.os }}/ | ||
tar czvf ./cfn-guard-v3-aarch64-${{ matrix.os }}.tar.gz ./cfn-guard-v3-aarch64-${{ matrix.os }} | ||
linux: | | ||
rustup target add x86_64-unknown-linux-musl | ||
cargo build --release --target x86_64-unknown-linux-musl | ||
mkdir cfn-guard-v3-x86_64-${{ matrix.os }} | ||
cp ./target/x86_64-unknown-linux-musl/release/cfn-guard ./cfn-guard-v3-x86_64-${{ matrix.os }}/ | ||
cp README.md ./cfn-guard-v3-x86_64-${{ matrix.os }}/ | ||
tar czvf ./cfn-guard-v3-x86_64-${{ matrix.os }}.tar.gz ./cfn-guard-v3-x86_64-${{ matrix.os }} | ||
sudo apt update | ||
sudo apt install gcc-aarch64-linux-gnu | ||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc | ||
rustup target add aarch64-unknown-linux-musl | ||
cargo build --release --target aarch64-unknown-linux-musl | ||
mkdir cfn-guard-v3-aarch64-${{ matrix.os }} | ||
cp ./target/aarch64-unknown-linux-musl/release/cfn-guard ./cfn-guard-v3-aarch64-${{ matrix.os }}/ | ||
cp README.md ./cfn-guard-v3-aarch64-${{ matrix.os }}/ | ||
tar czvf ./cfn-guard-v3-aarch64-${{ matrix.os }}.tar.gz ./cfn-guard-v3-aarch64-${{ matrix.os }} | ||
- name: Upload x86 Release Asset | ||
id: upload-x86_64-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get_release.outputs.upload_url }} | ||
asset_path: ./cfn-guard-v3-x86_64-${{ matrix.os }}.tar.gz | ||
asset_name: cfn-guard-v3-x86_64-${{ matrix.os }}.tar.gz | ||
asset_content_type: application/octet-stream | ||
- name: Upload arm64 Release Asset | ||
id: upload-aarch64-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get_release.outputs.upload_url }} | ||
asset_path: ./cfn-guard-v3-aarch64-${{ matrix.os }}.tar.gz | ||
asset_name: cfn-guard-v3-aarch64-${{ matrix.os }}.tar.gz | ||
asset_content_type: application/octet-stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters