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
29 changes: 15 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
push:
branches:
- main
- morpho-main

permissions:
attestations: write
Expand Down Expand Up @@ -121,14 +122,14 @@ jobs:
- Generated release files
- Generated checksums
branch: "release/${{ github.event.inputs.version_tag }}"
base: main
base: morpho-main
labels: release

# Run on release PR merge
release:
if: |
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/morpho-main') &&
contains(github.event.head_commit.message, 'chore: release')
runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-8vcpu-ubuntu-2404' || 'ubuntu-24.04' }}"
steps:
Expand Down Expand Up @@ -250,7 +251,7 @@ jobs:
docker-build-amd64:
runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-8vcpu-ubuntu-2404' || 'ubuntu-24.04' }}"
needs: [prepare-release, release]
if: always() && github.ref == 'refs/heads/main'
if: always() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/morpho-main')
timeout-minutes: 35
outputs:
digest_main: ${{ steps.build_main.outputs.digest }}
Expand Down Expand Up @@ -294,15 +295,15 @@ jobs:
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP 'release \K([0-9]+\.[0-9]+\.[0-9]+)')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Build+push by digest (main)
- name: Build+push by digest (branch)
id: build_main
if: github.event.inputs.version_tag == ''
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
platforms: linux/amd64
build-args: |
VERSION=main
VERSION=${{ github.ref_name }}
COMMIT_SHA=${{ steps.meta.outputs.short_sha }}
sbom: false # not supported on docker driver, maybe works with blacksmith?
outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }},push-by-digest=true
Expand Down Expand Up @@ -331,7 +332,7 @@ jobs:
docker-build-arm64:
runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-8vcpu-ubuntu-2404-arm' || 'ubuntu-24.04-arm' }}"
needs: [prepare-release, release]
if: always() && github.ref == 'refs/heads/main'
if: always() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/morpho-main')
timeout-minutes: 35
outputs:
digest_main: ${{ steps.build_main.outputs.digest }}
Expand Down Expand Up @@ -375,15 +376,15 @@ jobs:
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP 'release \K([0-9]+\.[0-9]+\.[0-9]+)')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Build+push by digest (main)
- name: Build+push by digest (branch)
id: build_main
if: github.event.inputs.version_tag == ''
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
platforms: linux/arm64
build-args: |
VERSION=main
VERSION=${{ github.ref_name }}
COMMIT_SHA=${{ steps.meta.outputs.short_sha }}
sbom: false # not supported on docker driver, maybe works with blacksmith?
outputs: type=registry,name=ghcr.io/${{ steps.meta.outputs.repo }},push-by-digest=true
Expand Down Expand Up @@ -412,7 +413,7 @@ jobs:
docker-manifest:
runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04' }}"
needs: [docker-build-amd64, docker-build-arm64]
if: always() && github.ref == 'refs/heads/main'
if: always() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/morpho-main')
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
Expand All @@ -439,17 +440,17 @@ jobs:
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP 'release \K([0-9]+\.[0-9]+\.[0-9]+)')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT

- name: Create multi-arch manifest for main
- name: Create multi-arch manifest for branch
id: main
if: github.event.inputs.version_tag == ''
run: |
docker buildx imagetools create \
-t ghcr.io/${{ steps.meta.outputs.repo }}:main \
-t ghcr.io/${{ steps.meta.outputs.repo }}:${{ github.ref_name }} \
ghcr.io/${{ steps.meta.outputs.repo }}@${{ needs.docker-build-amd64.outputs.digest_main }} \
ghcr.io/${{ steps.meta.outputs.repo }}@${{ needs.docker-build-arm64.outputs.digest_main }}

docker pull ghcr.io/${{ steps.meta.outputs.repo }}:main
DIGEST_MAIN=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ steps.meta.outputs.repo }}:main)
docker pull ghcr.io/${{ steps.meta.outputs.repo }}:${{ github.ref_name }}
DIGEST_MAIN=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/${{ steps.meta.outputs.repo }}:${{ github.ref_name }})
echo "digest_main=${DIGEST_MAIN#*@}" >> "$GITHUB_OUTPUT"

- name: Create multi-arch manifests for release
Expand Down Expand Up @@ -502,7 +503,7 @@ jobs:
docker-cleanup-sha256-tags:
runs-on: "${{ github.repository_owner == 'erpc' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04' }}"
needs: [docker-manifest]
if: always() && github.ref == 'refs/heads/main'
if: always() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/morpho-main')
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
Expand Down
4 changes: 2 additions & 2 deletions erpc/networks_failsafe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ func TestNetworkFailsafe_UpstreamGroupFilter(t *testing.T) {
},
}

rateLimitersRegistry, err := upstream.NewRateLimitersRegistry(&common.RateLimiterConfig{}, &log.Logger)
rateLimitersRegistry, err := upstream.NewRateLimitersRegistry(context.Background(), &common.RateLimiterConfig{}, &log.Logger)
require.NoError(t, err)

metricsTracker := health.NewTracker(&log.Logger, "test", time.Minute)
Expand Down Expand Up @@ -1509,7 +1509,7 @@ func TestNetworkFailsafe_UpstreamGroupFilter(t *testing.T) {
},
}

rateLimitersRegistry, err := upstream.NewRateLimitersRegistry(&common.RateLimiterConfig{}, &log.Logger)
rateLimitersRegistry, err := upstream.NewRateLimitersRegistry(context.Background(), &common.RateLimiterConfig{}, &log.Logger)
require.NoError(t, err)

metricsTracker := health.NewTracker(&log.Logger, "test", time.Minute)
Expand Down
Loading
Loading