-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tests/block-conversion
- Loading branch information
Showing
44 changed files
with
1,543 additions
and
853 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build and Push Docker Image to GitHub Container Registry | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: karnot-arc-runner-set | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
install: true | ||
driver: docker-container | ||
|
||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image to GitHub Container Registry | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/madara:latest | ||
ghcr.io/${{ github.repository_owner }}/madara:${{ github.event.release.tag_name }} | ||
labels: | | ||
org.opencontainers.image.source=${{ github.repository.html_url }} | ||
org.opencontainers.image.version=${{ github.event.release.tag_name }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Post successful message | ||
run: echo "Docker image built and pushed successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Create Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" # Triggers on version tags like v1.0.0 | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
create_release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Create GitHub Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
token: ${{ secrets.RELEASE_ACTION }} | ||
tag: ${{ github.ref_name }} | ||
name: Release ${{ github.ref_name }} | ||
commit: ${{ github.sha }} | ||
draft: false | ||
prerelease: false | ||
generateReleaseNotes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,48 @@ | ||
# Stage 1: Build the application | ||
FROM rust:1.78 AS builder | ||
|
||
# Install build dependencies | ||
RUN apt-get -y update && \ | ||
RUN apt-get -y update && \ | ||
apt-get install -y clang && \ | ||
apt-get autoremove -y; \ | ||
apt-get clean; \ | ||
apt-get autoremove -y; \ | ||
apt-get clean; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the working directory | ||
WORKDIR /usr/src/madara/ | ||
|
||
# Copy the source code | ||
# Copy the source code into the container | ||
COPY Cargo.toml Cargo.lock ./ | ||
COPY crates crates | ||
COPY cairo cairo | ||
COPY cairo_0 cairo_0 | ||
|
||
|
||
# Installing scarb, new since devnet integration | ||
# Installation steps are taken from the scarb build script | ||
# https://github.com/software-mansion/scarb/blob/main/install.sh | ||
ENV SCARB_VERSION="v2.8.2" | ||
ENV SCARB_REPO="https://github.com/software-mansion/scarb/releases/download" | ||
ENV PLATFORM="x86_64-unknown-linux-gnu" | ||
ENV SCARB_TARGET="/usr/src/scarb.tar.gz" | ||
ENV SHELL="/bin/bash" | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- ${SCARB_VERSION} | ||
ENV PATH="/root/.local/bin:${PATH}" | ||
RUN scarb --version | ||
|
||
RUN curl -fLS -o $SCARB_TARGET \ | ||
$SCARB_REPO/$SCARB_VERSION/scarb-$SCARB_VERSION-$PLATFORM.tar.gz && \ | ||
tar -xz -C /usr/src/ --strip-components=1 -f $SCARB_TARGET && \ | ||
mv /usr/src/bin/scarb /bin | ||
# Install runtime dependencies | ||
RUN apt-get -y update && \ | ||
apt-get install -y openssl ca-certificates busybox && \ | ||
apt-get autoremove -y; \ | ||
apt-get clean; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Build the application in release mode | ||
RUN cargo build --release | ||
|
||
# Stage 2: Create the final runtime image | ||
FROM debian:bookworm-slim | ||
|
||
FROM debian:bookworm | ||
# Install runtime dependencies | ||
RUN apt-get -y update && \ | ||
apt-get install -y openssl ca-certificates && \ | ||
apt-get autoremove -y; \ | ||
apt-get clean; \ | ||
RUN apt-get -y update && \ | ||
apt-get install -y openssl ca-certificates &&\ | ||
apt-get autoremove -y; \ | ||
apt-get clean; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the working directory | ||
WORKDIR /usr/local/bin | ||
|
||
# Copy the compiled binary from the builder stage | ||
COPY --from=builder /usr/src/madara/target/release/madara . | ||
|
||
# chain presets to be monted at startup | ||
VOLUME crates/primitives/chain_config/presets | ||
VOLUME crates/primitives/chain_config/resources | ||
|
||
# Set the entrypoint | ||
ENTRYPOINT ["./madara"] |
Oops, something went wrong.