From a0b3b595790e40af95817571ea45d06194cd43c8 Mon Sep 17 00:00:00 2001 From: Sergii Mikhtoniuk Date: Wed, 7 Feb 2024 19:16:31 -0800 Subject: [PATCH] Fixing multiplatform release --- .github/workflows/release.yaml | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 25a38fd..c8a4825 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,7 +11,6 @@ jobs: include: - runs-on: ubuntu-latest target: x86_64-unknown-linux-musl - - runs-on: macos-14 target: aarch64-apple-darwin name: Build @@ -28,9 +27,32 @@ jobs: with: target: ${{ matrix.target }} override: true + + - name: Install docker (macOS) + if: contains(matrix.runs-on, 'macos-') + # See: https://blog.netnerds.net/2022/11/docker-macos-github-actions/ + run: | + brew install docker + colima start + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Install musl (linux) + if: contains(matrix.target, '-musl') + # See: https://blog.urth.org/2023/03/05/cross-compiling-rust-projects-in-github-actions/ + run: | + sudo apt-get update --yes + sudo apt-get install --yes musl-tools + - name: Build engine run: | cargo build --release --target ${{ matrix.target }} + - name: Build image run: | docker build \ @@ -39,12 +61,6 @@ jobs: -t ${{ env.IMAGE }} \ -f image/Dockerfile \ . - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Publish image run: | docker push ${{ env.IMAGE }}