Skip to content
Merged
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
110 changes: 110 additions & 0 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: mev-commit-artifacts

on:
workflow_dispatch

jobs:
upload_contracts:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1

- name: Create Artifact
run: |
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION_TAG="${GITHUB_REF#refs/tags/v}"
else
VERSION_TAG=$(echo "${GITHUB_SHA:0:7}")
fi
ARTIFACT_NAME="contracts_${VERSION_TAG}.tar.gz"
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
tar -czvf ${ARTIFACT_NAME} ./contracts

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-2'

- name: Upload Artifact to AWS S3
run: |
aws s3 cp ${{ env.ARTIFACT_NAME }} s3://primev-infrastructure-artifacts

- name: Set Artifact Retention
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
aws s3api put-object-tagging \
--bucket primev-infrastructure-artifacts \
--key "${{ env.ARTIFACT_NAME }}" \
--tagging 'TagSet=[{Key=AutoDelete,Value=true}]'

upload_binaries:
runs-on: ubuntu-latest
strategy:
matrix:
module: [ infrastructure/tools/keystore-generator, p2p/integrationtest/bidder, p2p/integrationtest/provider, bridge/standard/bridge-v1, external/geth, oracle, p2p]
steps:
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: echo "FLAGS=--snapshot" >> $GITHUB_ENV

- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 1

- name: Setup Cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
**/go.work.sum
key: ${{ runner.os }}-go-${{ hashFiles('**/go.work.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22
check-latest: true
cache-dependency-path: go.work.sum

- name: Build Artifacts
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --config=./${{ matrix.module }}/.goreleaser.yml --clean ${{ env.FLAGS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-2'

- name: Upload Artifacts to AWS S3
run: |
aws s3 cp ./dist/ s3://primev-infrastructure-artifacts \
--recursive \
--exclude "*" \
--include "*.gz" \
--include "*.txt" \

- name: Set Artifacts Retention
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: |
ls -1 ./dist | grep '\.gz\|\.txt$' | while read -r file; do
echo "Tagging uploaded file $file for auto delete"
aws s3api put-object-tagging \
--bucket primev-infrastructure-artifacts \
--key "$file" \
--tagging 'TagSet=[{Key=AutoDelete,Value=true}]'
done
6 changes: 3 additions & 3 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
module: [ p2p, oracle, bridge/standard/bridge-v1, external/geth ]
module: [ bridge/standard/bridge-v1, external/geth, oracle, p2p ]
steps:
- if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
run: echo "flags=--snapshot" >> $GITHUB_ENV
run: echo "FLAGS=--snapshot" >> $GITHUB_ENV

- name: Checkout Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean --config=./${{ matrix.module }}/.goreleaser.yml ${{ env.flags }}
args: release --config=./${{ matrix.module }}/.goreleaser.yml --clean ${{ env.FLAGS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

68 changes: 0 additions & 68 deletions .github/workflows/s3.yml

This file was deleted.

10 changes: 6 additions & 4 deletions bridge/standard/bridge-v1/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: 1

project_name: mev-commit-bridge

builds:
- id: relayer
env:
Expand Down Expand Up @@ -40,7 +42,7 @@ archives:
- relayer
format: tar.gz
name_template: >-
mev-commit-bridge-
{{ .ProjectName }}-
{{- .Binary }}_
{{- if .IsSnapshot }}{{ .ShortCommit }}_
{{- else }}{{ .Version }}_
Expand All @@ -49,7 +51,7 @@ archives:
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}
{{ end }}
{{- end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
Expand All @@ -59,7 +61,7 @@ archives:
- user_cli
format: tar.gz
name_template: >-
mev-commit-bridge-
{{ .ProjectName }}-
{{- .Binary }}_
{{- if .IsSnapshot }}{{ .ShortCommit }}_
{{- else }}{{ .Version }}_
Expand All @@ -76,7 +78,7 @@ archives:

checksum:
name_template: >-
mev-commit-bridge_
{{ .ProjectName }}_
{{- if .IsSnapshot }}{{ .ShortCommit }}
{{- else }}{{ .Version }}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion external/geth
Submodule geth updated from 499b89 to ddedd5
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
go 1.22

use (
./infrastructure/tools/keystore_generator
./infrastructure/tools/keystore-generator
./bridge/standard/bridge-v1
./contracts-abi
./external/geth
Expand Down
47 changes: 47 additions & 0 deletions infrastructure/tools/keystore-generator/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: 1

project_name: keystore-generator

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
goarm:
- 7
ignore:
- goos: windows
goarch: arm64
dir: ./infrastructure/tools/keystore-generator
main: ./cmd
binary: "{{ .ProjectName }}"

archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- if .IsSnapshot }}{{ .ShortCommit }}_
{{- else }}{{ .Version }}_
{{ end }}
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}
{{- end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip

checksum:
name_template: >-
{{ .ProjectName }}_
{{- if .IsSnapshot }}{{ .ShortCommit }}
{{- else }}{{ .Version }}
{{- end -}}
_checksums.txt
8 changes: 5 additions & 3 deletions oracle/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: 1

project_name: mev-commit-oracle

builds:
- env:
- CGO_ENABLED=0
Expand All @@ -9,7 +11,7 @@ builds:
- amd64
dir: ./oracle
main: ./cmd
binary: mev-commit-oracle
binary: "{{ .ProjectName }}"
flags:
- -v
- -trimpath
Expand All @@ -27,15 +29,15 @@ archives:
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}
{{ end }}
{{- end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip

checksum:
name_template: >-
mev-commit-oracle_
{{ .ProjectName }}_
{{- if .IsSnapshot }}{{ .ShortCommit }}
{{- else }}{{ .Version }}
{{- end -}}
Expand Down
8 changes: 5 additions & 3 deletions p2p/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: 1

project_name: mev-commit

builds:
- env:
- CGO_ENABLED=0
Expand All @@ -17,7 +19,7 @@ builds:
goarch: arm64
dir: ./p2p
main: ./cmd
binary: mev-commit
binary: "{{ .ProjectName }}"
flags:
- -v
- -trimpath
Expand All @@ -37,15 +39,15 @@ archives:
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}
{{ end }}
{{- end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip

checksum:
name_template: >-
mev-commit_
{{ .ProjectName }}_
{{- if .IsSnapshot }}{{ .ShortCommit }}
{{- else }}{{ .Version }}
{{- end -}}
Expand Down
Loading