m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-08 05:03:49 -05:00

Build with docker instead

This commit is contained in:
Sergio
2024-07-09 11:15:49 +03:00
parent 41d2389efc
commit 89b3c6f83c
2 changed files with 24 additions and 21 deletions

View File

@@ -2,31 +2,35 @@ name: Build binaries
on:
push:
branches: [ "main" ]
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
arch:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install cross
run: cargo install cross
- name: Build
run: cross build --release --target ${{ matrix.arch }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cup-${{ matrix.arch }}
path: ./target/${{ matrix.arch }}/release/cup
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/sergi0g/cup:latest

View File

@@ -12,5 +12,4 @@ RUN cargo build --release
FROM scratch
COPY --from=build /cup/target/release/cup /cup
COPY --from=build /cup/target/release/cup.d /cup.d
ENTRYPOINT ["/cup"]