Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sidenaio committed Mar 3, 2023
1 parent eb8d29f commit 069579d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 10 deletions.
11 changes: 11 additions & 0 deletions .github/cross-linux-arch64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM rust:1
#FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge

# set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container
ENV CROSS_DOCKER_IN_DOCKER=true

RUN cargo install cross
RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install -qy curl && \
curl -sSL https://get.docker.com/ | sh
46 changes: 36 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,12 @@ jobs:
os: ubuntu-latest
artifact_name: 'libidena_wasm_linux_amd64'
- build: macos-x64
os: macos-11
os: macos-latest
artifact_name: 'libidena_wasm_darwin_amd64'
- build: macos-arm64
os: macos-11.0
target: aarch64-apple-darwin
artifact_name: 'libidena_wasm_darwin_arm64'
- build: windows-x64
os: windows-2019
os: windows-latest
artifact_name: 'libidena_wasm_windows_amd64'
target: x86_64-pc-windows-gnu
- build: linux-aarch64
os: ubuntu-latest
artifact_name: 'libidena_wasm_darwin_aarch64'
target: aarch64-unknown-linux-gnu
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -75,3 +67,37 @@ jobs:
with:
files: ${{ env.ASSET_NAME }}

linux_aarch64:
name: Linux aarch64
runs-on: ubuntu-latest
env:
BINARY_NAME: libidena_wasm.a
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-unknown-linux-gnu
- name: Build cross image
run: |
docker build -t idena-wasm/aarch64 ${GITHUB_WORKSPACE}/.github/cross-linux-aarch64/
env:
CROSS_DOCKER_IN_DOCKER: true
- name: Build idena-wasm binary
run: |
${CARGO_BINARY} build --target=aarch64-unknown-linux-gnu --release
env:
CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project idena-wasm/aarch64 cross
CROSS_DOCKER_IN_DOCKER: true
PKG_CONFIG_PATH: /usr/lib/aarch64-linux-gnu/pkgconfig
PKG_CONFIG_ALLOW_CROSS: true
- name: Rename output file
run: |
asset_name=libidena_wasm_linux_aarch64
mv target/release/${BINARY_NAME} ${asset_name}
echo "ASSET_NAME=${asset_name}" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.ASSET_NAME }}

0 comments on commit 069579d

Please sign in to comment.