mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-13 07:33:48 -05:00
Build with docker instead
This commit is contained in:
40
.github/workflows/build.yml
vendored
40
.github/workflows/build.yml
vendored
@@ -9,24 +9,28 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
arch:
|
|
||||||
- x86_64-unknown-linux-musl
|
|
||||||
- aarch64-unknown-linux-musl
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Install cross
|
|
||||||
run: cargo install cross
|
- name: Set up QEMU
|
||||||
- name: Build
|
uses: docker/setup-qemu-action@v3
|
||||||
run: cross build --release --target ${{ matrix.arch }}
|
|
||||||
env:
|
- name: Set up Docker Buildx
|
||||||
SCCACHE_GHA_ENABLED: "true"
|
uses: docker/setup-buildx-action@v3
|
||||||
RUSTC_WRAPPER: "sccache"
|
|
||||||
- name: Upload artifact
|
- name: Login to GitHub Container Registry
|
||||||
uses: actions/upload-artifact@v4
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
name: cup-${{ matrix.arch }}
|
registry: ghcr.io
|
||||||
path: ./target/${{ matrix.arch }}/release/cup
|
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
|
||||||
@@ -12,5 +12,4 @@ RUN cargo build --release
|
|||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=build /cup/target/release/cup /cup
|
COPY --from=build /cup/target/release/cup /cup
|
||||||
COPY --from=build /cup/target/release/cup.d /cup.d
|
|
||||||
ENTRYPOINT ["/cup"]
|
ENTRYPOINT ["/cup"]
|
||||||
Reference in New Issue
Block a user