Compare commits
2 Commits
ef1a922933
...
635488ddeb
Author | SHA1 | Date | |
---|---|---|---|
635488ddeb | |||
a7e06ca5ce |
37
.github/workflows/ci.yml
vendored
Normal file
37
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# .github/workflows/ci.yml
|
||||||
|
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
FORCE_COLOR: 1
|
||||||
|
steps:
|
||||||
|
- uses: earthly/actions/setup-earthly@v1
|
||||||
|
with:
|
||||||
|
version: v0.7.0
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Put back the git branch into git (Earthly uses it for tagging)
|
||||||
|
run: |
|
||||||
|
branch=""
|
||||||
|
if [ -n "$GITHUB_HEAD_REF" ]; then
|
||||||
|
branch="$GITHUB_HEAD_REF"
|
||||||
|
else
|
||||||
|
branch="${GITHUB_REF##*/}"
|
||||||
|
fi
|
||||||
|
git checkout -b "$branch" || true
|
||||||
|
- name: Docker Login
|
||||||
|
run: docker login docker.hibas123.de --username "$DOCKER_USERNAME" --password "$DOCKER_TOKEN"
|
||||||
|
- name: Earthly version
|
||||||
|
run: earthly --version
|
||||||
|
- name: Run build
|
||||||
|
run: earthly --push +docker-multi
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -838,7 +838,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustocat"
|
name = "rustocat"
|
||||||
version = "0.1.9"
|
version = "0.1.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rustocat"
|
name = "rustocat"
|
||||||
version = "0.1.9"
|
version = "0.1.10"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Socat in rust with many less features and a configuration file"
|
description = "Socat in rust with many less features and a configuration file"
|
||||||
license = "ISC"
|
license = "ISC"
|
||||||
|
27
Earthfile
Normal file
27
Earthfile
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
VERSION 0.7
|
||||||
|
FROM rust:alpine
|
||||||
|
WORKDIR /rustbuild
|
||||||
|
|
||||||
|
prepare-env:
|
||||||
|
RUN apk add --no-cache musl-dev libssl3 openssl-dev
|
||||||
|
RUN cargo search test # Super simple way to cache the cargo index
|
||||||
|
|
||||||
|
docker-multi:
|
||||||
|
BUILD --platform linux/amd64 --platform linux/arm64 +docker
|
||||||
|
|
||||||
|
build:
|
||||||
|
FROM +prepare-env
|
||||||
|
COPY . .
|
||||||
|
RUN cargo build --release
|
||||||
|
SAVE ARTIFACT target/release/rustocat rustocat
|
||||||
|
|
||||||
|
docker:
|
||||||
|
FROM alpine
|
||||||
|
RUN apk add --no-cache libssl3
|
||||||
|
COPY +build/rustocat rustocat
|
||||||
|
ENTRYPOINT ["/bin/sh"]
|
||||||
|
CMD ["-c", "/rustbuild/rustocat"]
|
||||||
|
ARG EARTHLY_TARGET_TAG
|
||||||
|
ARG TAG=$EARTHLY_TARGET_TAG
|
||||||
|
SAVE IMAGE --push docker.hibas123.de/rustocat:latest
|
||||||
|
SAVE IMAGE --push docker.hibas123.de/rustocat:$TAG
|
Loading…
Reference in New Issue
Block a user