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
40 changes: 33 additions & 7 deletions .github/workflows/build-docker-proto-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,59 @@ name: Build and Push harmony proto Docker Image
on:
workflow_dispatch:

permissions: {}
jobs:
build_and_push:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read

steps:
- name: Checkout harmony core code
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
path: harmony
ref: ${{ github.ref }}
fetch-depth: 0
fetch-depth: 1
persist-credentials: false

- name: Get image version
id: image-version
run: |
set -euo pipefail

SHORT_SHA="$(git -C harmony rev-parse --short=12 HEAD)"
FULL_SHA="$(git -C harmony rev-parse HEAD)"

echo "short_sha=${SHORT_SHA}" >> "$GITHUB_OUTPUT"
echo "full_sha=${FULL_SHA}" >> "$GITHUB_OUTPUT"

- name: Set up QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 #v4.2.0
with:
platforms: arm64
cache-image: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 #v4.1.0

- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee #v4.2.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v6
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a #v7.3.0
with:
context: ./harmony/api/service/synchronize/legacysync/downloader
file: ./harmony/api/service/synchronize/legacysync/downloader/Proto.Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
harmonyone/harmony-proto:latest
murme123/harmony-proto:${{ steps.image-version.outputs.short_sha }}
murme123/harmony-proto:latest
labels: |
org.opencontainers.image.revision=${{ steps.image-version.outputs.full_sha }}
org.opencontainers.image.version=${{ steps.image-version.outputs.short_sha }}
35 changes: 35 additions & 0 deletions .github/workflows/zizmor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: GitHub Actions Security Analysis with zizmor 🌈

on:
push:
branches:
- main
- dev
paths:
- '.github/workflows/**/*.yml'
- '.github/workflows/**/*.yaml'

pull_request:
branches: ["**"]
paths:
- '.github/workflows/**/*.yml'
- '.github/workflows/**/*.yaml'

permissions: {}

jobs:
zizmor:
name: Run zizmor 🌈
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
persist-credentials: false
fetch-depth: 1

- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7
with:
inputs: ./.github/
advanced-security: false
13 changes: 8 additions & 5 deletions api/service/synchronize/legacysync/downloader/Proto.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM golang:1.24.2-bullseye

RUN apt update
RUN apt install -y protobuf-compiler
RUN protoc --version
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.30.0
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3
# hadolint ignore=DL3008
RUN apt-get update > /dev/null 2>&1 && \
apt-get install -y protobuf-compiler --no-install-recommends && \
protoc --version && \
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.30.0 && \
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3 && \
apt-get clean > /dev/null 2>&1 && \
rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["protoc", "-I=/tmp", "--go_out=/tmp", "--go-grpc_out=/tmp"]