diff options
| author | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2023-01-20 20:32:02 +0400 |
|---|---|---|
| committer | MatthieuCoder <matthieu@matthieu-dev.xyz> | 2023-01-20 20:32:02 +0400 |
| commit | a177fe775c2201ea5032dce6fc8352bbe659dabc (patch) | |
| tree | c02062763b9cf5b5d8c9eba6074d4031de877337 /.github/workflows | |
| parent | 191f0cfb06d086c070bbcbb8499e0c1b656268a1 (diff) | |
use matrix build
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/build.yml | 17 | ||||
| -rw-r--r-- | .github/workflows/docker-publish.yml | 11 |
2 files changed, 25 insertions, 3 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d461060..86bc815 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,6 +69,16 @@ jobs: build_linux: name: 'Build for Linux' runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: + - aarch64-unknown-linux-gnu + - aarch64-unknown-linux-musl + - armv7-unknown-linux-gnueabi + - armv7-unknown-linux-musleabi + - x86_64-unknown-linux-gnu + - x86_64-unknown-linux-musl steps: - uses: actions/checkout@v2 - uses: ATiltedTree/setup-rust@v1 @@ -82,12 +92,15 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - key: ${{ runner.os }}-cargo + key: ${{ runner.os }}-cargo-${{ matrix.arch }} - name: Build all run: | cargo install cross --force export CROSS_CONTAINER_ENGINE_NO_BUILDKIT=1 - ./.ci/build.sh + cross build --release --target ${{ matrix.arch }} + mkdir -p ./build + cp target/${{ matrix.arch }}/release/* ./build/ || true + rm ./build/*.{d,rlib} - uses: actions/upload-artifact@v3 with: name: release diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5c07593..51eaf03 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -11,6 +11,13 @@ env: jobs: bake: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: + - linux/amd64 + - linux/arm64/v8 + - linux/arm/v7 steps: - name: Checkout uses: actions/checkout@v3 @@ -22,7 +29,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 with: - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64/v8,linux/arm/v7 - name: Log into registry ${{ env.REGISTRY }} uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c @@ -30,6 +37,7 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push uses: docker/bake-action@v2 with: @@ -37,3 +45,4 @@ jobs: set: | *.cache-from=type=gha *.cache-to=type=gha,mode=max + *.platform=${{ matrix.platform }} |
