Skip to content

Commit

Permalink
Web3review (#13)
Browse files Browse the repository at this point in the history
Added support for macos images; pump to risc-zero v0.21, added listener
component to react on new documents arriving on directory

---------

Co-authored-by: dastansam <[email protected]>
Co-authored-by: wasabrot <[email protected]>
Co-authored-by: vladae36 <[email protected]>
  • Loading branch information
4 people authored Mar 17, 2024
1 parent 651815e commit bb1a18c
Show file tree
Hide file tree
Showing 30 changed files with 5,083 additions and 185 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docker-build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker Build MacOs

on:
push:
branches: [ macos ]

jobs:
build:
runs-on: macos-latest # , l5, self-hosted
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v3

-
name: Set up Docker
uses: crazy-max/ghaction-setup-docker@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image (manual)
run: |
docker buildx build -f DockerfileMacOs --load -t test .

42 changes: 16 additions & 26 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Docker Build

on:
push:
branches: [ main, ms1review ]
branches: [ main ]

pull_request:
branches: [ main ]
Expand All @@ -28,7 +28,7 @@ jobs:
INITIAL_VERSION: 0.1.0

- name: Bump version and push tag, Minor version for each merge
if: github.event_name != 'pull_request'
if: github.event_name == 'push'
uses: anothrNick/[email protected]
id: taggerRun
env:
Expand All @@ -37,60 +37,50 @@ jobs:
DEFAULT_BUMP: patch

- name: echo tag
if: github.event_name != 'pull_request'
run: |
echo "The current tag is: ${{ steps.taggerRun.outputs.new_tag }}"
- name: echo part
if: github.event_name != 'pull_request'
run: |
echo "The version increment was: ${{ steps.taggerRun.outputs.part }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image (manual)
run: |
docker build --no-cache -t e36io/hyperfridge-r0:${{ github.run_id }} .
docker buildx build -f DockerfileLinux --load -t e36io/hyperfridge-r0:${{ github.run_id }} .
- name: Create and Run Temporary Container
run: |
docker create --name temp-container e36io/hyperfridge-r0:${{ github.run_id }}
docker cp temp-container:/app/IMAGE_ID.hex ./IMAGE_ID.hex
docker cp temp-container:/app ./app
docker cp temp-container:/data ./data
docker rm temp-container
docker rm temp-container
- name: Read the Image Tag
id: read_tag
run: echo "IMAGE_TAG=$(cat IMAGE_ID.hex)" >> $GITHUB_ENV

- name: Zip App and Data Directories to create a release
if: github.event_name != 'pull_request'
run: |
zip -r hyperfridge-${{ env.IMAGE_TAG }}-${{ steps.taggerRun.outputs.new_tag }}.zip ./app ./data
- name: Build and Push Docker image with custom tag
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
e36io/hyperfridge-r0:${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }}
e36io/hyperfridge-r0:latest
- name: Create GitHub Release with zipped binaries
if: github.event_name != 'pull_request'
if: github.event_name == 'push'
run: |
gh release create ${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }} hyperfridge-${{ env.IMAGE_TAG }}-${{ steps.taggerRun.outputs.new_tag }}.zip --title "Release Version ${{ steps.taggerRun.outputs.new_tag }} Image ID:${{ env.IMAGE_TAG }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push Docker image to Docker Hub with additional tags
if: github.event_name == 'push'
run: |
docker tag e36io/hyperfridge-r0:${{ github.run_id }} e36io/hyperfridge-r0:${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }}
docker push e36io/hyperfridge-r0:${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }}
docker tag e36io/hyperfridge-r0:${{ github.run_id }} e36io/hyperfridge-r0:latest
docker push e36io/hyperfridge-r0:latest
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk
Expand Down Expand Up @@ -37,3 +37,15 @@ data/test/tmp/*
cobertura.xml
methods/guest/build_rs_cov.profraw
tmp/
bin
data/test/test.xml-Receipt-90ae877c92ba8275f1345254efad79312bbe8dec1b4c7160a2558cbefc68b3c5-latest.json
release
macos-release.zip
data/work
data/trace
data/profile-output
data.sik
data/data
data/test

Dockerfile copy
Loading

0 comments on commit bb1a18c

Please sign in to comment.