Skip to content

Commit

Permalink
feat: release workflow pushes to Manifold GHCR
Browse files Browse the repository at this point in the history
fix: Replace deprecated goreleaser flag --skip-publish
fix: Replace deprecated goreleaser flag --rm-dist
fix: Update docker/metadata-action to latest
fix: Add write permission to release workflow
  • Loading branch information
srounce authored and zimbatm committed Jun 28, 2024
1 parent 7a6469e commit c7bbf1a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

permissions:
contents: write
packages: write

jobs:
docker-image:
Expand All @@ -20,33 +21,38 @@ jobs:
- name: Get tag version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Get release date
run: |
echo "RELEASE_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
- name: Print version
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Extract metadata (tags, labels) for Docker images
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@f7b4ed12385588c3f9bc252f0a2b520d83b52d48
with:
images: flashbots/mev-boost
images: ghcr.io/${{ github.event.repository.full_name }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=pep440,pattern={{version}}
type=pep440,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ !contains(env.RELEASE_VERSION, '-') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Login to DockerHub
uses: docker/login-action@v2
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
Expand All @@ -55,6 +61,8 @@ jobs:
push: true
build-args: |
VERSION=${{ env.RELEASE_VERSION }}
VCS_REF=${{ github.event.ref }}
BUILD_DATE=${{ env.RELEASE_DATE }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -77,7 +85,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --skip-publish --config .goreleaser-build.yaml --rm-dist
args: release --skip=publish --config .goreleaser-build.yaml --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload
Expand Down Expand Up @@ -120,4 +128,4 @@ jobs:
with:
args: release --config .goreleaser-release.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# syntax=docker/dockerfile:1
FROM golang:1.22 as builder
ARG VERSION
ARG VCS_REF
ARG BUILD_DATE
WORKDIR /build

COPY go.mod ./
Expand Down

0 comments on commit c7bbf1a

Please sign in to comment.