Skip to content

Commit

Permalink
Add nightly releases (#200)
Browse files Browse the repository at this point in the history
* Add nightly releases

* Remove tag info

* Change name of workflow

* Apply feedback

* Inverse

* One more
  • Loading branch information
ferranbt authored Feb 19, 2024
1 parent 0f45f36 commit e4dee3f
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .github/workflows/release.yml
name: release-nightly

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup dependencies
uses: actions/setup-go@v2

- name: Login to Docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.FLASHBOTS_DOCKERHUB_USERNAME }}
password: ${{ secrets.FLASHBOTS_DOCKERHUB_TOKEN }}

- name: Create release
run: make release
env:
NIGHTLY: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
33 changes: 27 additions & 6 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ dockers:
- --platform=linux/amd64
image_templates:
- "flashbots/suave-geth:{{ .ShortCommit }}-amd64"
- "flashbots/suave-geth:{{ .Tag }}-amd64"
- "flashbots/suave-geth:latest-amd64"
- "flashbots/suave-geth:v{{ .Version }}-amd64"
{{- if .IsNightly }}
- flashbots/suave-geth:latest-nightly-amd64
{{ else }}
- flashbots/suave-geth:latest-amd64
{{- end }}
- dockerfile: ./Dockerfile.suave
use: buildx
goarch: arm64
Expand All @@ -106,8 +110,12 @@ dockers:
- --platform=linux/arm64
image_templates:
- "flashbots/suave-geth:{{ .ShortCommit }}-arm64"
- "flashbots/suave-geth:{{ .Tag }}-arm64"
- "flashbots/suave-geth:latest-arm64"
- "flashbots/suave-geth:v{{ .Version }}-arm64"
{{- if .IsNightly }}
- flashbots/suave-geth:latest-nightly-arm64
{{ else }}
- flashbots/suave-geth:latest-arm64
{{- end }}

docker_manifests:
- name_template: "flashbots/suave-geth:{{ .ShortCommit }}"
Expand All @@ -118,10 +126,23 @@ docker_manifests:
image_templates:
- "flashbots/suave-geth:{{ .Tag }}-amd64"
- "flashbots/suave-geth:{{ .Tag }}-arm64"
{{- if .IsNightly }}
- name_template: "flashbots/suave-geth:latest-nightly"
image_templates:
- "flashbots/suave-geth:latest-nightly-amd64"
- "flashbots/suave-geth:latest-nightly-arm64"
{{ else }}
- name_template: "flashbots/suave-geth:latest"
image_templates:
- "flashbots/suave-geth:latest-amd64"
- "flashbots/suave-geth:latest-arm64"
- "flashbots/suave-geth:latest-amd64"
- "flashbots/suave-geth:latest-arm64"
{{- end }}

nightly:
name_template: "{{ incpatch .Version }}-nightly"
tag_name: latest-nightly
publish_release: true
keep_single_release: true

checksum:
name_template: "checksums.txt"
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ devnet-down:
fmt-contracts:
cd suave && forge fmt

ifeq ($(NIGHTLY),true)
NIGHTLY_FLAG=--nightly
else
NIGHTLY_FLAG=
endif

release:
docker run \
--rm \
Expand All @@ -66,4 +72,4 @@ release:
-v `pwd`/sysroot:/sysroot \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:v1.19.5 \
release --clean --auto-snapshot
release --clean --auto-snapshot $(NIGHTLY_FLAG)

0 comments on commit e4dee3f

Please sign in to comment.