Skip to content

Commit

Permalink
added support for macos-latest aarch64 (#219)
Browse files Browse the repository at this point in the history
* added macos release

Signed-off-by: danbugs <[email protected]>

* added M1 binary

Signed-off-by: danbugs <[email protected]>

* added new rustup target

Signed-off-by: danbugs <[email protected]>

* updated openssl var name

Signed-off-by: danbugs <[email protected]>

* brought back old openssl var together with new one

Signed-off-by: danbugs <[email protected]>

* vendoring openssl

Signed-off-by: danbugs <[email protected]>

* windows dynamically links openssl

Signed-off-by: danbugs <[email protected]>

* corrected path for slight release

Signed-off-by: danbugs <[email protected]>

* quick undo

Signed-off-by: danbugs <[email protected]>

* addressing PR comments

Signed-off-by: danbugs <[email protected]>

Signed-off-by: danbugs <[email protected]>
  • Loading branch information
danbugs committed Oct 17, 2022
1 parent f96e7fd commit 49c6410
Show file tree
Hide file tree
Showing 10 changed files with 377 additions and 223 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ apt-get install -y \
build-essential \
cmake \
libssl-dev \
openssl \
openssl \
unzip

## update and install 2nd level of packages
Expand Down
34 changes: 22 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ jobs:
matrix:
config:
- os: "ubuntu-latest"
extension: ""
platformAgnosticChecks: true
- os: "macos-latest"
extension: ""
extraArgs: ""
- {
os: "macos-latest",
arch: "amd64"
}
- {
os: macos-latest,
arch: aarch64,
extraArgs: "--target aarch64-apple-darwin"
}
- os: "windows-latest"
extension: ".exe"
extraArgs: ""

steps:
#
Expand All @@ -51,9 +55,11 @@ jobs:
- name: "Install Dependencies on Linux"
run: make install-deps
if: ${{ fromJSON(matrix.config.os == 'ubuntu-latest') }}

- name: "Install Dependencies on MacOS"
run: make install-deps-macos
if: ${{ fromJSON(matrix.config.os == 'macos-latest') }}

- name: "Install Dependencies on Windows"
run: |
choco install wget
Expand All @@ -62,7 +68,6 @@ jobs:
mkdir -p /opt/wasi-sdk
mv wasi-sdk-15.0/* /opt/wasi-sdk/
make install-deps-win
ls /opt/wasi-sdk/bin/
if: ${{ fromJSON(matrix.config.os == 'windows-latest') }}

Expand All @@ -71,6 +76,7 @@ jobs:
run: |
rustup target add wasm32-wasi
rustup target add wasm32-unknown-unknown
rustup target add aarch64-apple-darwin
- name: "Install wit-bindgen-cli"
run: cargo install --git https://github.com/bytecodealliance/wit-bindgen wit-bindgen-cli --tag v0.2.0
Expand All @@ -88,16 +94,21 @@ jobs:

- name: "Build SpiderLightning and Slight"
run: make build
if: ${{ fromJSON(matrix.config.os == 'macos-latest') }}
env:
OPENSSL_ROOT_DIR: /usr/local/opt/openssl
if: ${{ fromJSON(matrix.config.os == 'macos-latest') &&
fromJSON(matrix.config.arch == 'amd64') }}

- name: "Build SpiderLightning and Slight"
run: cargo build --manifest-path ./slight/Cargo.toml --release ${{ matrix.config.extraArgs }}
if: ${{ fromJSON(matrix.config.os == 'macos-latest') &&
fromJSON(matrix.config.arch == 'aarch64') }}

- name: "Build SpiderLightning and Slight"
run: make build
if: ${{ fromJSON(matrix.config.os == 'windows-latest') }}
env:
OPENSSL_DIR: C:\Program Files\OpenSSL-Win64\

OPENSSL_NO_VENDOR: true

- name: "Build Rust Examples"
run: make build-rust

Expand All @@ -123,11 +134,10 @@ jobs:
- name: "Run Unit Tests"
run: make test
if: ${{ fromJSON(matrix.config.os == 'macos-latest') }}
env:
OPENSSL_ROOT_DIR: /usr/local/opt/openssl

- name: "Run Unit Tests"
run: make test
if: ${{ fromJSON(matrix.config.os == 'windows-latest') }}
env:
OPENSSL_DIR: C:\Program Files\OpenSSL-Win64\
OPENSSL_NO_VENDOR: true
63 changes: 54 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ jobs:
config:
- os: ubuntu-latest
- os: windows-latest
- {
os: macos-latest,
arch: amd64
}
- {
os: macos-latest,
arch: aarch64,
extraArgs: "--target aarch64-apple-darwin"
}

steps:
- uses: actions/checkout@v1
Expand All @@ -35,10 +44,11 @@ jobs:
- name: "add rustup wasm targets"
run: |
rustup target add wasm32-wasi
rustup target add wasm32-unknown-unknown
rustup target add wasm32-unknown-unknown
rustup target add aarch64-apple-darwin
- run : choco install openssl
if: ${{ fromJSON(matrix.config.os == 'windows-latest') }}
if: ${{ fromJSON(matrix.config.os == 'windows-latest') }}

- name: "build for unix"
run: make build
Expand All @@ -49,26 +59,61 @@ jobs:
if: ${{ fromJSON(matrix.config.os == 'windows-latest') }}
env:
OPENSSL_DIR: C:\Program Files\OpenSSL-Win64\
OPENSSL_NO_VENDOR: true

- name: "build for macos amd64"
run: make build
if: ${{ fromJSON(matrix.config.os == 'macos-latest') &&
fromJSON(matrix.config.arch == 'amd64') }}

- name: "build for macos aarch64"
run: cargo build --manifest-path ./slight/Cargo.toml --release ${{ matrix.config.extraArgs }}
if: ${{ fromJSON(matrix.config.os == 'macos-latest') &&
fromJSON(matrix.config.arch == 'aarch64') }}

- run: make prepare-release
if: ${{ fromJSON(matrix.config.os == 'ubuntu-latest') }}

- run: make prepare-release-win
if: ${{ fromJSON(matrix.config.os == 'windows-latest') }}

- name: "add wits, and slight-unix and templates tars to release"
- run: make prepare-release-mac
if: ${{ fromJSON(matrix.config.os == 'macos-latest') &&
fromJSON(matrix.config.arch == 'amd64') }}

- name: "tar release for macos-aarch64"
run: tar -C target/ -czvf slight-macos-aarch64.tar.gz aarch64-apple-darwin/release/slight
if: ${{ fromJSON(matrix.config.os == 'macos-latest') &&
fromJSON(matrix.config.arch == 'aarch64') }}

- name: "add wits, and slight-linux-x86_64 and templates tars to release"
uses: softprops/action-gh-release@v1
with:
files: |
slight-unix.tar.gz
slight-linux-x86_64.tar.gz
*-template.tar.gz
wit/*.wit
if: ${{ fromJSON(matrix.config.os == 'ubuntu-latest') }}

- name: "add slight-win tar to release"
- name: "add slight-windows tar to release"
uses: softprops/action-gh-release@v1
with:
files: |
slight-windows-x86_64.tar.gz
if: ${{ fromJSON(matrix.config.os == 'windows-latest') }}

- name: "add slight-macos-amd64 tar to release"
uses: softprops/action-gh-release@v1
with:
files: |
slight-macos-amd64.tar.gz
if: ${{ fromJSON(matrix.config.os == 'macos-latest') &&
fromJSON(matrix.config.arch == 'amd64') }}

- name: "add slight-macos-aarch64 tar to release"
uses: softprops/action-gh-release@v1
with:
files: |
slight-win.tar.gz
if: ${{ fromJSON(matrix.config.os == 'windows-latest') }}

slight-macos-aarch64.tar.gz
if: ${{ fromJSON(matrix.config.os == 'macos-latest') &&
fromJSON(matrix.config.arch == 'aarch64') }}
Loading

0 comments on commit 49c6410

Please sign in to comment.