Skip to content
Closed
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
5 changes: 5 additions & 0 deletions .changeset/fast-pumpkins-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/sdk": patch
---

add cartesi/rollups-database container image release
5 changes: 5 additions & 0 deletions .changeset/honest-spoons-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/sdk": patch
---

bump debian base image to bookworm-20250317-slim
5 changes: 5 additions & 0 deletions .changeset/hot-timers-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/sdk": patch
---

create databases and run migrations for preinitialized PostgreSQL database
91 changes: 91 additions & 0 deletions .github/workflows/rollups-database.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: rollups-database
on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
pull_request:
paths:
- .github/workflows/rollups-database.yaml
- packages/sdk/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
permissions:
contents: read
packages: write
id-token: write
actions: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Get package tag/version
id: package-version
if: ${{ github.event_name == 'push' }}
run: |
jq -r '"PACKAGE_VERSION=\(.version)"' packages/sdk/package.json >> "$GITHUB_OUTPUT"

- name: Docker meta
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: |
docker.io/cartesi/rollups-database,enable=${{ github.event_name != 'pull_request' }}
ghcr.io/cartesi/rollups-database
tags: |
type=raw,value=${{ steps.package-version.outputs.PACKAGE_VERSION }},enable=${{ github.event_name == 'push' }}
type=ref,event=pr
labels: |
org.opencontainers.image.title=Cartesi Rollups Database
org.opencontainers.image.description=Cartesi Rollups SDK Database with pre-initialized PostgreSQL Database

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0

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

- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/bake-action@4a9a8d494466d37134e2bfca2d3a8de8fb2681ad # v5.13.0
if: ${{ !startsWith(github.ref, 'refs/tags/sdk@') }}
with:
workdir: packages/sdk
targets: database
files: |
./docker-bake.hcl
./docker-bake.platforms.hcl
${{ steps.meta.outputs.bake-file }}
set: |
*.cache-from=type=registry,ref=ghcr.io/cartesi/sdk-cache:shared
*.cache-to=type=registry,ref=ghcr.io/cartesi/sdk-cache:shared,mode=max
push: true

- uses: depot/setup-action@b0b1ea4f69e92ebf5dea3f8713a1b0c37b2126a5 # v1.6.0
- name: Build and push (depot)
uses: depot/bake-action@58d7160c6bfa64eb85e384209e6f2f5ad17948bb # v1.11.0
if: ${{ startsWith(github.ref, 'refs/tags/sdk@') }}
with:
project: ${{ vars.DEPOT_PROJECT }}
workdir: packages/sdk
targets: database
files: |
./docker-bake.hcl
./docker-bake.platforms.hcl
${{ steps.meta.outputs.bake-file }}
push: true
91 changes: 91 additions & 0 deletions .github/workflows/runtime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: runtime
on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
pull_request:
paths:
- .github/workflows/runtime.yaml
- packages/sdk/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
permissions:
contents: read
packages: write
id-token: write
actions: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Get package tag/version
id: package-version
if: ${{ github.event_name == 'push' }}
run: |
jq -r '"PACKAGE_VERSION=\(.version)"' packages/sdk/package.json >> "$GITHUB_OUTPUT"

- name: Docker meta
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: |
docker.io/cartesi/sdk-node,enable=${{ github.event_name != 'pull_request' }}
ghcr.io/cartesi/sdk-node
tags: |
type=raw,value=${{ steps.package-version.outputs.PACKAGE_VERSION }},enable=${{ github.event_name == 'push' }}
type=ref,event=pr
labels: |
org.opencontainers.image.title=Cartesi Rollups SDK Node
org.opencontainers.image.description=Cartesi Rollups SDK Node with optional services

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0

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

- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/bake-action@4a9a8d494466d37134e2bfca2d3a8de8fb2681ad # v5.13.0
if: ${{ !startsWith(github.ref, 'refs/tags/sdk@') }}
with:
workdir: packages/sdk
targets: runtime
files: |
./docker-bake.hcl
./docker-bake.platforms.hcl
${{ steps.meta.outputs.bake-file }}
set: |
*.cache-from=type=registry,ref=ghcr.io/cartesi/sdk-cache:shared
*.cache-to=type=registry,ref=ghcr.io/cartesi/sdk-cache:shared,mode=max
push: true

- uses: depot/setup-action@b0b1ea4f69e92ebf5dea3f8713a1b0c37b2126a5 # v1.6.0
- name: Build and push (depot)
uses: depot/bake-action@58d7160c6bfa64eb85e384209e6f2f5ad17948bb # v1.11.0
if: ${{ startsWith(github.ref, 'refs/tags/sdk@') }}
with:
project: ${{ vars.DEPOT_PROJECT }}
workdir: packages/sdk
targets: runtime
files: |
./docker-bake.hcl
./docker-bake.platforms.hcl
${{ steps.meta.outputs.bake-file }}
push: true
4 changes: 2 additions & 2 deletions .github/workflows/sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:
./docker-bake.platforms.hcl
${{ steps.meta.outputs.bake-file }}
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
*.cache-from=type=registry,ref=ghcr.io/cartesi/sdk-cache:shared
*.cache-to=type=registry,ref=ghcr.io/cartesi/sdk-cache:shared,mode=max
push: true

- uses: depot/setup-action@b0b1ea4f69e92ebf5dea3f8713a1b0c37b2126a5 # v1.6.0
Expand Down
Loading
Loading