Skip to content

Commit

Permalink
Upgrading GitHub CI to latest + bump to Ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
maoueh committed Dec 11, 2024
1 parent f6ecbc0 commit dc703e7
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build docker image
on:
push:
tags:
- "[a-z0-9]+-v*"
- "v*"
branches:
- "dockerbuild"
- "develop"
Expand All @@ -16,59 +16,64 @@ env:

jobs:
build-and-push-image:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: "${{ !startsWith(github.event.head_commit.message, 'GitBook: [#') }}"
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version-file: './go.mod'

- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build Binary
run: go build -v -o ./substreams ./cmd/substreams

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate docker tags/labels from github build context
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=sha,prefix=
type=raw,enable=${{ github.ref == 'refs/heads/develop' }},value=develop
type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.extract_branch.outputs.release_train }}
type=edge,branch=develop
flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/') }}
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile.github
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
# org.opencontainers.image.version will match the tag name
labels: ${{ steps.meta.outputs.labels }}
20 changes: 16 additions & 4 deletions Dockerfile.github
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
FROM ubuntu:20.04
FROM --platform=$BUILDPLATFORM golang:1.23-bullseye AS build

WORKDIR /src

ARG TARGETOS TARGETARCH

RUN --mount=target=. \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /app/substreams .

FROM ubuntu:22.04

RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get -y install -y ca-certificates libssl1.1
apt-get -y install -y ca-certificates libssl3

COPY --from=build /app/substreams /app/substreams

ADD ./substreams /app/substreams
ENTRYPOINT /app/substreams
ENTRYPOINT ["/app/substreams"]
5 changes: 5 additions & 0 deletions docs/release-notes/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

* Substreams CLI is now built with using Ubuntu 22, previous releases were built using Ubuntu 20.
* Substreams Docker image is now using `ubuntu:22` as its base, previous releases were built using `ubuntu:20.04`.

## v1.11.1

- Fix the `gui` breaking when the network field is not set in the spkg
Expand Down

0 comments on commit dc703e7

Please sign in to comment.