Skip to content

Commit

Permalink
feat: Add Cartesi Machine installation to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoura committed Apr 16, 2024
1 parent 771a9d2 commit 14a147f
Showing 1 changed file with 5 additions and 73 deletions.
78 changes: 5 additions & 73 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
with:
submodules: recursive

- name: Install Cartesi Machine Deps
run: sudo apt update && sudo apt install -y build-essential libboost-all-dev wget
working-directory: .

- uses: depot/setup-action@v1
- name: Build dependency images
uses: depot/bake-action@v1
Expand Down Expand Up @@ -102,76 +106,4 @@ jobs:
working-directory: ${{ github.workspace }}
run: go test ./...

build_docker:
runs-on: ubuntu-22.04
needs:
- test
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: |
name=ghcr.io/cartesi/rollups-node
name=docker.io/cartesi/rollups-node,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=ref,event=pr
- name: Login to Docker Hub
uses: docker/login-action@v3
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: depot/setup-action@v1
- name: Build and push docker image
id: docker_build
uses: depot/bake-action@v1
with:
files: |
./docker-bake.hcl
${{ steps.docker_meta.outputs.bake-file }}
./docker-bake.platforms.hcl
targets: rollups-node
set: rollups-node.args.ROLLUPS_NODE_VERSION=${{ steps.docker_meta.outputs.version }}
push: true
project: ${{ vars.DEPOT_PROJECT }}
workdir: build

release:
needs: [test, build_docker]
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Trim CHANGELOG.md
run: sed -e '0,/^##[^#]/d' -e '/^##[^#]/,$d' -i CHANGELOG.md

- name: Download GraphQL schema
uses: actions/download-artifact@v4
with:
name: graphql-schema

- name: Publish Github release
uses: softprops/action-gh-release@v2
with:
prerelease: true
body_path: CHANGELOG.md
files: schema.graphql

0 comments on commit 14a147f

Please sign in to comment.