Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
lance.zhou committed Sep 12, 2024
1 parent 1803473 commit ac26eb3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,37 @@ name: build

on:
push:
workflow_dispatch:


jobs:
buildx:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
platforms: linux/arm64
tags: ${{ secrets.TAGS }}
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=local,dest=.
- name: Upload module artifact
uses: actions/upload-artifact@v4
with:
name: netmuxd
path: output/
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

default-run = "netmuxd"
#default-run = "netmuxd"

[[bin]]
name = "passthrough"
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic-20220427 as builder
FROM ubuntu:jammy as builder

Check warning on line 1 in Dockerfile

View workflow job for this annotation

GitHub Actions / buildx

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

WORKDIR /work

Expand All @@ -17,9 +17,9 @@ RUN apt-get update \
udev \
libplist++-dev libtool autoconf automake \
python3 python3-dev \
curl usbmuxd \
curl usbmuxd libcurl4-openssl-dev \
wget lsb-release wget software-properties-common \
clang-10
clang

RUN for i in /etc/ssl/certs/*.pem; do HASH=$(openssl x509 -hash -noout -in $i); ln -s $(basename $i) /etc/ssl/certs/$HASH.0 || true; done

Expand All @@ -32,8 +32,8 @@ RUN . "$HOME/.cargo/env" && cargo install cargo-chef
RUN git clone https://github.com/zeyugao/zeroconf-rs.git \
&& git clone https://github.com/jkcoxson/mdns.git

RUN cd zeroconf-rs && git checkout 860b030064308d4318e2c6936886674d955c6472 && cd .. \
&& cd mdns && git checkout 961ab21b5e01143dc3a7f0ba5f654285634e5569 && cd ..
#RUN cd zeroconf-rs && git checkout 860b030064308d4318e2c6936886674d955c6472 && cd .. \
# && cd mdns && git checkout 961ab21b5e01143dc3a7f0ba5f654285634e5569 && cd ..

RUN mkdir netmuxd
COPY Cargo.toml netmuxd
Expand All @@ -60,3 +60,5 @@ RUN apt-get update \
libavahi-client-dev

COPY --from=builder /output/ /usr/local/bin/

COPY --from=builder /output/ .

0 comments on commit ac26eb3

Please sign in to comment.