Skip to content

Commit

Permalink
Add repro-env
Browse files Browse the repository at this point in the history
  • Loading branch information
kpcyrd committed Feb 10, 2024
1 parent 3179dbf commit e01c658
Show file tree
Hide file tree
Showing 5 changed files with 528 additions and 11 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up cargo cache
- name: 🏗️ Setup build cache
uses: actions/cache@v3
continue-on-error: false
with:
Expand All @@ -25,14 +25,23 @@ jobs:
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-

- name: Build
run: cargo build --release --verbose
- name: 🚚 Install dependencies (repro-env)
run: |
wget 'https://github.com/kpcyrd/repro-env/releases/download/v0.3.2/repro-env'
echo '660995089d32178a63763cf47e1b97e265ef5cf24bf646d16728ca51bf2fab50 repro-env' | sha256sum -c -
sudo install -m755 repro-env -t /usr/bin
- name: 🛠️ Build
run: make

- name: Print sha256 of binary
run: sha256sum target/x86_64-unknown-linux-musl/release/rshijack

- name: Upload binary
- name: 📦 Upload binary
uses: actions/upload-artifact@v3
with:
name: bin
path: target/release/rshijack
path: target/x86_64-unknown-linux-musl/release/rshijack

cross:
runs-on: ubuntu-latest
Expand All @@ -50,12 +59,10 @@ jobs:
binutils: aarch64-linux-gnu
- name: aarch64-unknown-linux-musl
binutils: aarch64-linux-gnu
- name: riscv64gc-unknown-linux-gnu
binutils: riscv64-linux-gnu
- name: powerpc64le-unknown-linux-gnu
binutils: powerpc64le-linux-gnu
- name: mipsel-unknown-linux-gnu
binutils: mipsel-linux-gnu
- name: mips64el-unknown-linux-gnuabi64
binutils: mips64el-linux-gnuabi64
- name: s390x-unknown-linux-gnu
binutils: s390x-linux-gnu
steps:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:alpine3.17
FROM rust:alpine3.19
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN apk add musl-dev
WORKDIR /app
Expand All @@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/var/cache/buildkit \
cp -v /var/cache/buildkit/target/release/rshijack .
RUN strip rshijack

FROM alpine:3.17
FROM alpine:3.19
RUN apk add --no-cache libgcc
COPY --from=0 /app/rshijack /usr/local/bin/rshijack
ENTRYPOINT ["rshijack"]
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build:
repro-env build -- sh -c ' \
RUSTFLAGS="-C strip=symbols" \
cargo build --target x86_64-unknown-linux-musl --release'

.PHONY: build
Loading

0 comments on commit e01c658

Please sign in to comment.