diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 935cff4021..048a77064d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -428,6 +428,17 @@ jobs: - name: Install sccache uses: mozilla-actions/sccache-action@v0.0.5 + - name: Prep + run: sudo apt-get install musl-tools -y + + - name: Build iroh + run: cargo build --profile=dev-ci --all-features --bin iroh --target x86_64-unknown-linux-musl + + - name: Prep bins + run: | + mkdir -p bins/linux/amd64 + cp target/x86_64-unknown-linux-musl/dev-ci/iroh bins/linux/amd64/iroh + - name: Cleanup Docker continue-on-error: true run: | @@ -445,12 +456,14 @@ jobs: tags: n0computer/iroh-test:latest target: iroh platforms: linux/amd64 - file: docker/Dockerfile + file: docker/Dockerfile.ci - name: Run Docker image & stats test run: | docker run -p 9090:9090 -p 4919:4919/udp -Pd n0computer/iroh-test:latest --rpc-addr 0.0.0.0:4919 start - cargo run --bin iroh -- --rpc-addr 127.0.0.1:4919 stats + # Give the server time to start + sleep 3 + target/x86_64-unknown-linux-musl/dev-ci/iroh --rpc-addr 127.0.0.1:4919 stats codespell: runs-on: ubuntu-latest diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index c98b0e2a95..84f794c47f 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -88,7 +88,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - push: true + push: ${{ github.event.inputs.publish }} tags: n0computer/iroh:latest,n0computer/iroh:${{ github.event.inputs.release_version }} target: iroh platforms: linux/amd64,linux/arm64/v8 @@ -98,7 +98,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - push: true + push: ${{ github.event.inputs.publish }} tags: n0computer/iroh-relay:latest,n0computer/iroh-relay:${{ github.event.inputs.release_version }} target: iroh-relay platforms: linux/amd64,linux/arm64/v8 @@ -108,7 +108,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - push: true + push: ${{ github.event.inputs.publish }} tags: n0computer/iroh-dns-server:latest,n0computer/iroh-dns-server:${{ github.event.inputs.release_version }} target: iroh-dns-server platforms: linux/amd64,linux/arm64/v8 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e70cd8c2be..0d382045b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -267,6 +267,7 @@ jobs: docker: needs: build_release uses: './.github/workflows/docker.yaml' + secrets: inherit with: release_version: ${{ needs.build_release.outputs.release_version }} base_hash: ${{ needs.build_release.outputs.base_hash }} diff --git a/Cargo.toml b/Cargo.toml index ef573e9338..aaa48b79e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,10 @@ resolver = "2" [profile.release] debug = true +[profile.dev-ci] +inherits = 'dev' +opt-level = 1 + [profile.optimized-release] inherits = 'release' debug = false diff --git a/docker/Dockerfile.ci b/docker/Dockerfile.ci index 4557737368..29384bad72 100644 --- a/docker/Dockerfile.ci +++ b/docker/Dockerfile.ci @@ -1,10 +1,10 @@ ### Base image for iroh-relay and iroh-dns-server -FROM alpine:latest as base +FROM alpine:latest AS base RUN apk update && apk add ca-certificates && update-ca-certificates ### Target image -FROM base as iroh +FROM base AS iroh ARG TARGETPLATFORM COPY bins/${TARGETPLATFORM}/iroh /iroh @@ -20,7 +20,7 @@ ENTRYPOINT ["/iroh"] CMD ["start"] ### Target image -FROM base as iroh-relay +FROM base AS iroh-relay ARG TARGETPLATFORM COPY bins/${TARGETPLATFORM}/iroh-relay /iroh-relay @@ -36,7 +36,7 @@ ENTRYPOINT ["/iroh-relay"] CMD [""] ### Target image -FROM base as iroh-dns-server +FROM base AS iroh-dns-server ARG TARGETPLATFORM COPY bins/${TARGETPLATFORM}/iroh-dns-server /iroh-dns-server