Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and publish binaries for releases #98

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ _local
.idea
.git
.github
varia/Dockerfile.tests
varia/Dockerfile.ci
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release build
on:
release:
types: [created]

env:
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: docker build . --pull -f varia/Dockerfile.ci --tag ego-build
- name: Get binary file
run: |
mkdir -p dist
docker run --rm ego-build cat target/release/ego > dist/ego
cd dist && tar czf ego-x86_64-linux.tar.gz ego
- uses: actions/upload-artifact@v3
with:
name: ego-x86_64-linux.tar.gz
path: dist/ego-x86_64-linux.tar.gz
if-no-files-found: error
12 changes: 11 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build
run: docker build . --pull -f varia/Dockerfile.tests --tag ego-build
run: docker build . --pull -f varia/Dockerfile.ci --tag ego-build
- name: Test suite
run: docker run --rm ego-build cargo test --color=always
- name: Clippy lints
run: docker run --rm ego-build cargo clippy --color=always
- name: rustfmt
run: docker run --rm ego-build cargo fmt -- --color=always --check
- name: Get binary file
run: |
mkdir -p dist
docker run --rm ego-build cat target/release/ego > dist/ego
cd dist && tar czf ego-x86_64-linux.tar.gz ego
- uses: actions/upload-artifact@v3
with:
name: ego-x86_64-linux.tar.gz
path: dist/ego-x86_64-linux.tar.gz
if-no-files-found: error
7 changes: 5 additions & 2 deletions varia/Dockerfile.tests → varia/Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This Dockerfile is mostly for CI, see .github/workflows/tests.yml
FROM rust AS ego-build
# Using Debian 'bullseye' as base, it has older glibc that's likely to be compatible with recent desktop distributions.
FROM rust:bullseye AS ego-build

WORKDIR /root/build
# Make warnings fatal
Expand All @@ -19,4 +20,6 @@ RUN mkdir src/ && \

# Do the actual build
COPY . .
RUN cargo build --bins --tests --color=always
RUN cargo build --tests --color=always
# Release build for publishing binaries
RUN cargo build --release --bins --color=always && strip target/release/ego