Skip to content

Commit

Permalink
Add multiplatform linux build to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
abihf committed Nov 3, 2022
1 parent 7827ade commit 2d8d832
Showing 1 changed file with 74 additions and 12 deletions.
86 changes: 74 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,39 @@ jobs:
linux:
name: Build - Linux
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: linux-arm64-gnu
target: aarch64-unknown-linux-gnu
- name: linux-arm64-musl
target: aarch64-unknown-linux-musl
- name: linux-x64-gnu
target: x86_64-unknown-linux-gnu
- name: linux-x64-musl
target: x86_64-unknown-linux-musl
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up docker image
run: docker build -t volta .
working-directory: ./ci/docker
- name: Compile and package Volta
run: docker run --volume ${PWD}:/root/workspace --workdir /root/workspace --rm --init --tty volta /root/workspace/ci/build-linux.sh volta-linux
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.63
override: true
- name: Cargo Cache
uses: Swatinem/rust-cache@v2
- name: Install cross
run: cargo install cross
- name: Build
run: cross build --release --target ${{ matrix.target }}
- name: Create artifact
run: tar -czvf volta-${{ matrix.name }}.tar.gz volta volta-shim volta-migrate
working-directory: target/${{ matrix.target }}/release
- name: Upload release artifact
uses: actions/upload-artifact@v2
with:
name: linux
path: target/release/volta-linux.tar.gz
name: ${{ matrix.name }}
path: target/${{ matrix.target }}/release/volta-${{ matrix.name }}.tar.gz

macos:
name: Build - MacOS
Expand Down Expand Up @@ -144,10 +164,25 @@ jobs:
env:
TAG: ${{ github.ref }}
run: echo "::set-output name=version::${TAG:11}"
- name: Fetch Linux artifact
- name: Fetch linux-arm64-gnu artifact
uses: actions/download-artifact@v2
with:
name: linux
name: linux-arm64-gnu
path: release
- name: Fetch linux-arm64-musl artifact
uses: actions/download-artifact@v2
with:
name: linux-arm64-musl
path: release
- name: Fetch linux-x64-gnu artifact
uses: actions/download-artifact@v2
with:
name: linux-x64-gnu
path: release
- name: Fetch linux-x64-musl artifact
uses: actions/download-artifact@v2
with:
name: linux-x64-musl
path: release
- name: Fetch MacOS artifact
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -180,14 +215,41 @@ jobs:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
- name: Upload Linux artifact
- name: Upload Linux artifact (arm64-gnu)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/volta-linux-arm64-gnu.tar.gz
asset_name: volta-${{ steps.release_info.outputs.version }}-linux-arm64-gnu.tar.gz
asset_content_type: application/gzip
- name: Upload Linux artifact (arm64-musl)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/volta-linux-arm64-musl.tar.gz
asset_name: volta-${{ steps.release_info.outputs.version }}-linux-arm64-musl.tar.gz
asset_content_type: application/gzip
- name: Upload Linux artifact (x64-gnu)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/volta-linux-x64-gnu.tar.gz
asset_name: volta-${{ steps.release_info.outputs.version }}-linux-x64-gnu.tar.gz
asset_content_type: application/gzip
- name: Upload Linux artifact (x64-musl)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release/volta-linux.tar.gz
asset_name: volta-${{ steps.release_info.outputs.version }}-linux.tar.gz
asset_path: ./release/volta-linux-x64-musl.tar.gz
asset_name: volta-${{ steps.release_info.outputs.version }}-linux-x64-musl.tar.gz
asset_content_type: application/gzip
- name: Upload MacOS artifact
uses: actions/upload-release-asset@v1
Expand Down

0 comments on commit 2d8d832

Please sign in to comment.