diff --git a/.github/workflows/sf-release.yml b/.github/workflows/sf-release.yml deleted file mode 100644 index 2e36019c202..00000000000 --- a/.github/workflows/sf-release.yml +++ /dev/null @@ -1,171 +0,0 @@ -# StreamingFast Docker image build, push and (on tag) release. -# -# Maintained by StreamingFast and intentionally kept separate from upstream CI -# so that upstream merges stay clean. -# -# Triggers: manual dispatch only. The `release/optimism-2.x` branch exists so downstream -# projects can pin a git ref; it must never publish a Docker image or a GitHub -# release on its own. Only `release/reth-2.x` ships artifacts. GitHub Actions -# requires at least one event, so `workflow_dispatch` is the closest thing to -# "never"; the file is kept rather than deleted so upstream merges stay -# conflict-free. -# -# Single architecture (linux/amd64): the `reth` `maxperf` full-node build is too -# heavy to reliably build on GitHub-hosted arm64 runners, so we do not produce a -# multi-arch manifest. Re-introduce a matrix + manifest-merge job here if arm64 -# becomes worthwhile. -name: Build image (manual only) - -on: - workflow_dispatch: - inputs: - firehose_ethereum: - description: "Bundled Firehose Ethereum (fireeth) image tag" - required: false - default: "latest" - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build: - runs-on: ubuntu-24.04 - - permissions: - contents: read - packages: write - - env: - # Tag pushes, branch pushes, same-repo PRs and manual dispatch can - # authenticate to ghcr and push images. A PR opened from a fork gets a - # read-only GITHUB_TOKEN with no `packages: write`, so we must skip login - # and push for it — the build still runs to validate the Dockerfile - # compiles. The value is the string "true"/"false". - IS_EXTERNAL_PR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to the Container registry - if: env.IS_EXTERNAL_PR != 'true' - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract version - id: extract-version - run: | - version="edge" - if [[ "${GITHUB_REF}" == refs/tags/* ]]; then - version=${GITHUB_REF#refs/tags/} - fi - # Docker tags forbid `/`; a tag (or ref) containing slashes would make - # the `-` tag invalid. Match docker/metadata-action's own - # sanitization by replacing `/` with `-`. - version=${version//\//-} - echo "VERSION=${version}" >> "$GITHUB_OUTPUT" - - - name: Generate docker tags/labels from github build context - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # The version-suffixed sha tag uniquely identifies the image for a given - # build, appending the extracted version (either `edge` or the tag). This - # avoids a race condition when a tag and its branch are pushed together: - # both builds run on the same commit and would otherwise push the same - # `` tag, with the last writer winning and possibly clobbering the - # tag build's version label. The `-` tag stays distinct - # (`-edge` vs `-v2.2.0-fh1`), and the `release` job below - # reads `-` so it always picks up the correct image. - tags: | - type=ref,event=tag,prefix= - type=ref,event=branch - type=ref,event=pr - type=sha,prefix= - type=sha,prefix=,suffix=-${{ steps.extract-version.outputs.VERSION }} - type=edge - flavor: | - latest=${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc') && !contains(github.ref, 'alpha') }} - - - name: Build and push Docker image (linux/amd64) - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile.sf - platforms: linux/amd64 - push: ${{ env.IS_EXTERNAL_PR != 'true' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - provenance: false - # Cache the cargo-chef dependency layer across runs (ephemeral runners - # otherwise cold-rebuild all deps every time). Keyed per profile by - # buildx, so branch/PR (release) and tag (maxperf) caches stay separate. - cache-from: type=gha - cache-to: type=gha,mode=max - build-args: | - VERSION=${{ steps.extract-version.outputs.VERSION }} - FIREHOSE_ETHEREUM=${{ inputs.firehose_ethereum || 'latest' }} - # Full LTO `maxperf` is only worth its long link tail for shippable - # builds (tags); branch pushes, PRs and manual dispatch use the - # `release` profile (thin LTO) to validate faster. - BUILD_PROFILE=${{ startsWith(github.ref, 'refs/tags/') && 'maxperf' || 'release' }} - - release: - # Disabled on this branch: tags here are reference points for downstream - # projects, not shippable artifacts. Releases are cut from - # `release/reth-2.x` only. - if: false - needs: build - runs-on: ubuntu-24.04 - - permissions: - contents: write - - steps: - - name: Docker login - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract image - id: image - run: | - version=${GITHUB_REF#refs/tags/} - # Match the sanitization done in the build job's "Extract version" step - # so this ID resolves to the same `-` image tag. - version=${version//\//-} - echo "ID=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${GITHUB_SHA::7}-${version}" >> "$GITHUB_OUTPUT" - - - name: Extract assets - run: | - # The --platform is not strictly needed for a single-arch image, but it - # silences the buildx warning. - docker cp $(docker create --platform=linux/amd64 ${{ steps.image.outputs.ID }}):/usr/local/bin/reth ./reth_linux_amd64 - - - name: Extract Changelog - id: changelog - run: | - curl -L https://github.com/streamingfast/sfreleaser/releases/download/v0.12.1/sfreleaser_linux_x86_64.tar.gz | tar -xz - chmod +x sfreleaser - - ./sfreleaser changelog extract-section \ - github://token:${{ github.token }}@${{ github.repository }}/$GITHUB_SHA/CHANGELOG.md \ - --github-output="changelog:$GITHUB_OUTPUT" - - - name: Release - uses: softprops/action-gh-release@v2 - with: - body: ${{ steps.changelog.outputs.changelog }} - prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') || contains(github.ref, 'alpha') }} - files: | - ./reth_linux_amd64 diff --git a/.sfreleaser b/.sfreleaser new file mode 100644 index 00000000000..17f179f9014 --- /dev/null +++ b/.sfreleaser @@ -0,0 +1,5 @@ +global: + language: rust + variant: chain +release: + changelog-path: CHANGELOG.sf.md diff --git a/CHANGELOG.md b/CHANGELOG.sf.md similarity index 100% rename from CHANGELOG.md rename to CHANGELOG.sf.md