Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
09bb114
docs: add NetworkActor V2 implementation plan and completion summary
michaelgpt Sep 19, 2025
9f39eba
feat: add NetworkActor V2 infrastructure and dependencies
michaelgpt Sep 19, 2025
0350c3b
feat(network): implement NetworkActor V2 core modules
michaelgpt Sep 19, 2025
cf7621e
feat(network): implement NetworkActor and SyncActor V2
michaelgpt Sep 19, 2025
348c5ac
feat(network): add manager components and protocol handlers
michaelgpt Sep 19, 2025
f334756
feat(network): implement libp2p behaviour and RPC interface with mDNS
michaelgpt Sep 19, 2025
6fb6263
feat(testing): add NetworkActor V2 testing framework
michaelgpt Sep 19, 2025
65653b7
feat(examples): add NetworkActor V2 demonstration scripts
michaelgpt Sep 19, 2025
03ec338
chore: update Cargo.lock for NetworkActor V2 dependencies
michaelgpt Sep 19, 2025
75ef3af
feat(network): re-enable RPC module and refine NetworkActor request h…
michaelgpt Sep 20, 2025
dbe953b
fix: resolve infinite recursion bug in NetworkMetrics and SyncMetrics
michaelgpt Sep 20, 2025
f829fb3
fix: eliminate circular import dependencies in NetworkActor V2 modules
michaelgpt Sep 20, 2025
7455e40
feat(testing): implement comprehensive NetworkActor V2 testing framework
michaelgpt Sep 20, 2025
9c830f2
feat(ci): add comprehensive CI/CD pipeline for NetworkActor V2 testing
michaelgpt Sep 20, 2025
4b16cb3
docs: add comprehensive NetworkActor V2 testing documentation
michaelgpt Sep 20, 2025
0bb5c87
feat(debug): add NetworkActor creation debugging tools
michaelgpt Sep 20, 2025
11411c5
feat(docs): add comprehensive onboarding knowledge book for NetworkAc…
michaelgpt Sep 21, 2025
ca00e3f
feat(docs): introduce comprehensive implementation plan for ChainActo…
michaelgpt Sep 21, 2025
993b075
feat(docs): enhance implementation plan for ChainActor V2
michaelgpt Sep 21, 2025
95f0089
feat(docs): expand ChainActor V2 implementation plan with NetworkActo…
michaelgpt Sep 21, 2025
e1ebb3d
feat(chain): implement ChainActor V2 with simplified architecture and…
michaelgpt Sep 21, 2025
518ad94
feat(chain): add ChainActor testing framework with fixtures and integ…
michaelgpt Sep 21, 2025
c007712
feat(chain): enhance ChainActor with block storage and validation imp…
michaelgpt Sep 22, 2025
c29473f
feat(chain): enhance ChainActor testing framework with new features a…
michaelgpt Sep 22, 2025
42990d6
feat(docs): introduce comprehensive documentation for Alys V2 Actor S…
michaelgpt Sep 23, 2025
076c423
feat(common): introduce common utilities and types for V2 actors
michaelgpt Sep 29, 2025
3a0a678
fix(storage): add message types for block storage and retrieval
michaelgpt Sep 29, 2025
a3955e0
feat(docs): add comprehensive documentation for V0 AuxPow, Engine, an…
michaelgpt Sep 29, 2025
3c02931
feat(docs): enhance V2 block production documentation and prerequisit…
michaelgpt Sep 29, 2025
2343657
refactor(docs): update V2 architecture description and status
michaelgpt Sep 29, 2025
07e5e67
feat(engine): implement EngineActor for execution layer coordination
michaelgpt Sep 30, 2025
bfe25d1
feat(chain): update block handling to utilize SignedConsensusBlock
michaelgpt Sep 30, 2025
7161037
feat(chain): implement basic block production and import foundations
michaelgpt Sep 30, 2025
26972ad
feat(chain, engine): implement complete block production pipeline and…
michaelgpt Sep 30, 2025
d2f3708
feat(chain): enhance block production with validator address and fee …
michaelgpt Oct 1, 2025
3111985
feat(chain): implement advanced block import pipeline with enhanced l…
michaelgpt Oct 1, 2025
e3e0c72
feat(chain): implement real peg-in and peg-out processing with async …
michaelgpt Oct 3, 2025
0202674
fix(chain): improve peg-in processing with async RwLock access
michaelgpt Oct 3, 2025
5fef365
refactor(chain): streamline block production and import processes wit…
michaelgpt Oct 3, 2025
177d2c7
feat(chain): implement performance monitoring system for ChainActor
michaelgpt Oct 4, 2025
9648382
feat(chain): integrate AuxPoW functionality into ChainActor for enhan…
michaelgpt Oct 4, 2025
a91a4ea
refactor(auxpow): add constructor for AuxBlock to streamline mining p…
michaelgpt Oct 6, 2025
64296fa
feat(chain): add chain_id to ChainConfig and introduce NoWorkToDo error
michaelgpt Oct 6, 2025
c310563
feat(chain): enhance AuxPoW validation and mining context management
michaelgpt Oct 7, 2025
8b62435
feat(chain): implement AuxPoW handling and mining context management
michaelgpt Oct 7, 2025
c1dd07f
feat(network): enhance block request handling and timeout management
michaelgpt Oct 7, 2025
307af1d
feat(chain): add chain_id field to ChainConfig for enhanced configura…
michaelgpt Oct 7, 2025
aad7cae
feat(rpc): implement V2 RPC server and actor system initialization
michaelgpt Oct 9, 2025
eae191e
feat(actors_v2): add AuraSlotWorkerV2 for block production timing
michaelgpt Oct 9, 2025
4ae2825
fix(federation): improve error handling in Bitcoin block stream proce…
michaelgpt Oct 9, 2025
41193fd
feat(rpc): implement JSON-RPC server with createauxblock and submitau…
michaelgpt Oct 9, 2025
0275f78
fix(chain): update block production logic to use execution hashes and…
michaelgpt Oct 9, 2025
ddd5ca5
refactor(storage): update block handling to utilize execution payload…
michaelgpt Oct 9, 2025
f7871fe
refactor(chain): update block reference handling to utilize execution…
michaelgpt Oct 9, 2025
43e7ec3
feat(network): enhance NetworkActor initialization and message handling
michaelgpt Oct 10, 2025
d66d588
feat(network): complete Phase 1 with working libp2p event loop and in…
michaelgpt Oct 12, 2025
1bf3200
feat(network): implement SSZ-based request-response protocol types
michaelgpt Oct 12, 2025
2107bd6
feat(network): implement SwarmCommand channel foundation (Phase 2 Tas…
michaelgpt Oct 12, 2025
4fd88cd
feat(network): implement real Gossipsub broadcasting (Phase 2 Task 2.1)
michaelgpt Oct 12, 2025
9b56c04
feat(network): complete request-response codec implementation (Phase …
michaelgpt Oct 12, 2025
8bd6ad5
feat(network): enable automatic mDNS discovery (Phase 2 Task 2.4)
michaelgpt Oct 12, 2025
70adec9
feat(network): complete Phase 3 - comprehensive testing and swarm com…
michaelgpt Oct 12, 2025
06b700f
fix(network): resolve port timing issue in connection recovery test
michaelgpt Oct 12, 2025
2a89f85
docs: update V2_MASTER_TESTING_GUIDE with Phase 3 achievements
michaelgpt Oct 12, 2025
173b269
docs: add comprehensive Phase 4 Production Readiness specification
michaelgpt Oct 12, 2025
f15cee0
feat(network): implement Phase 4 Task 4.1 peer reputation and rate li…
michaelgpt Oct 12, 2025
536f1d7
feat(network): add DOS protection to gossip message handlers
michaelgpt Oct 12, 2025
6819415
feat(network): implement Phase 4 Task 4.2 production monitoring & obs…
michaelgpt Oct 12, 2025
72d2e00
feat(network): implement Phase 4 Task 4.2.3 enhanced health check end…
michaelgpt Oct 12, 2025
a06f57f
feat(network): complete Phase 4 production readiness implementation
michaelgpt Oct 12, 2025
a452fac
refactor(network): remove unnecessary calculation in rate limiting check
michaelgpt Oct 12, 2025
5658efd
refactor(tests): update connection limits and message validation in t…
michaelgpt Oct 12, 2025
06372d7
docs: update V2_MASTER_TESTING_GUIDE with Phase 4 completion details
michaelgpt Oct 12, 2025
1d80022
docs: remove outdated implementation documents and add new operations…
michaelgpt Oct 12, 2025
30c6c18
docs: update NetworkActor V2 module documentation to reflect protocol…
michaelgpt Oct 13, 2025
a7078e1
refactor(rpc): remove HTTP server start/stop methods from RpcActor
michaelgpt Oct 13, 2025
50f21be
docs: update onboarding knowledge book for NetworkActor V2
michaelgpt Oct 13, 2025
37e637f
feat(network): increase connection limits and adjust validation logic
michaelgpt Oct 14, 2025
4379824
fix(network): correct validation logic for connection limits
michaelgpt Oct 20, 2025
14f854e
build(regtest): add two-node regtest setup and verification scripts
michaelgpt Oct 20, 2025
aad1c02
chore(workflows): update pull request branches for Docker publish wor…
michaelgpt Oct 20, 2025
86c7caa
chore(docker): add Clang and LLVM dependencies to Dockerfile
michaelgpt Oct 20, 2025
f69bcc5
chore(docker): support multi-platform builds in Docker publish workflow
michaelgpt Oct 20, 2025
a9eb067
fix(engine): enhance error handling and logging in block commitment p…
michaelgpt Oct 20, 2025
8c45979
feat(keygen): add key generation utility for Alys V2
michaelgpt Oct 21, 2025
c887811
refactor(spec): update public keys and federation configuration
michaelgpt Oct 21, 2025
7b6cf24
fix(keygen): remove leading zero from Bitcoin public key formatting
michaelgpt Oct 21, 2025
2a024a3
refactor(spec): update public keys and federation configuration
michaelgpt Oct 21, 2025
165ec51
feat(app): add dev-regtest cli arg support and validation
michaelgpt Oct 21, 2025
8c31495
refactor(network): update gossip topic format in NetworkConfig
michaelgpt Oct 21, 2025
192fa46
feat(network): enhance Gossipsub configuration for small networks
michaelgpt Oct 22, 2025
2f43dfd
refactor(engine): *IMPORTANT* streamline payload submission and forkc…
michaelgpt Oct 22, 2025
2403c20
feat(docker): update regtest configuration for multi-node setup
michaelgpt Oct 22, 2025
43e776a
feat(network): implement block reception and forwarding pipeline
michaelgpt Oct 22, 2025
e3a44c6
feat(chain): implement block import queue and locking mechanism
michaelgpt Oct 22, 2025
caa3aa0
feat(validation): add block signature and parent relationship validation
michaelgpt Oct 22, 2025
205b691
feat(fork_choice): implement fork choice logic for block canonicality
michaelgpt Oct 22, 2025
af921cb
refactor(app): remove unused miner binary configuration from Cargo.toml
michaelgpt Oct 22, 2025
dda30e3
feat(reorganization): implement chain reorganization logic for better…
michaelgpt Oct 22, 2025
3942ce8
feat(docker): add git version check and lighthouse remote validation …
michaelgpt Oct 22, 2025
51d23ee
chore(dependencies): update lighthouse dependencies to specific commi…
michaelgpt Oct 22, 2025
c7dba8a
chore(docker): enhance Dockerfile with git installation and cleanup s…
michaelgpt Oct 22, 2025
b053131
fix(docker): correct Dockerfile syntax for apt-get commands
michaelgpt Oct 22, 2025
6859c59
feat(metrics): enhance chain and network metrics for Phase 5
michaelgpt Oct 23, 2025
aa03c16
chore: applying cargo fmt fixes
michaelgpt Oct 23, 2025
b479abb
feat(database): implement asynchronous database opening with blocking…
michaelgpt Oct 23, 2025
7424ee1
chore(docker): update Dockerfile for improved build process
michaelgpt Oct 23, 2025
417cead
fix(Cargo.lock): update lighthouse dependency source URLs for consist…
michaelgpt Oct 23, 2025
b916b70
refactor(database): streamline database opening process by removing u…
michaelgpt Oct 24, 2025
8a8cc2d
refactor(database): enhance asynchronous database opening with improv…
michaelgpt Oct 25, 2025
04d7b4f
refactor(database): simplify database opening by removing unnecessary…
michaelgpt Oct 26, 2025
9b86ff0
refactor(app): update V2 RPC server initialization and application ru…
michaelgpt Oct 26, 2025
c4daff7
fix(network): add explicit peer grafting for gossipsub mesh formation
michaelgpt Oct 27, 2025
bb589f1
feat(docs): add comprehensive development and monitoring guides for A…
michaelgpt Oct 27, 2025
f2769ea
feat(docker): add development mode configurations with hot-reload for…
michaelgpt Oct 27, 2025
a6af16b
feat(grafana): add Alys V2 dashboards and Prometheus datasource confi…
michaelgpt Oct 27, 2025
9eba73e
refactor(app): update gossip topics for Alys V2
michaelgpt Oct 28, 2025
ae01431
fix(v2/chain): use actual parent consensus hash instead of slot-deriv…
michaelgpt Oct 28, 2025
aeda9f6
refactor(chain): improve block production pipeline with sync status c…
michaelgpt Oct 28, 2025
b42e72c
fix(validation): handle zero parent hash for first block after genesis
michaelgpt Oct 28, 2025
f4a7694
feat(chain): implement genesis block initialization and validation
michaelgpt Oct 30, 2025
54a12ec
feat(sync): introduce synchronization protocol with state management
michaelgpt Oct 30, 2025
4780dbe
refactor(protocols): remove sync module and clean up protocol exports
michaelgpt Oct 30, 2025
d08dedf
fix(network): add immediate peer addition to gossipsub mesh and enabl…
michaelgpt Oct 30, 2025
5badea4
fix(engine): simplify block validation logic by removing unnecessary …
michaelgpt Oct 31, 2025
9b6f20b
fix(docs): update path in local-regtest development guide for docker-…
michaelgpt Nov 3, 2025
17f6475
chore(.gitignore): add new directories to ignore list knowledge files
michaelgpt Nov 3, 2025
1da11ec
chore(workflows): update Docker publish workflow for multi-platform s…
michaelgpt Nov 3, 2025
98d7765
chore(workflows): normalize image name to lowercase in Docker publish…
michaelgpt Nov 3, 2025
6b64bd1
chore(workflows): update Docker publish workflow to use PLATFORM_SLUG…
michaelgpt Nov 3, 2025
a648c19
chore(workflows): refine Docker publish workflow for native multi-pla…
michaelgpt Nov 4, 2025
12f7f3c
chore(workflows): duplicate normalization step for image name in Dock…
michaelgpt Nov 4, 2025
47aaffd
feat(v2/sync): implement SyncActor validation routing and automatic s…
michaelgpt Nov 6, 2025
4d4dbb7
chore: fix cargo fmt issues
michaelgpt Nov 6, 2025
84e9d23
feat(v2/sync): implement SyncActor validation routing through ChainAc…
michaelgpt Nov 7, 2025
e25732d
feat(v2/sync): add ChainActor height queries and sync completion (Pha…
michaelgpt Nov 7, 2025
4dedcb9
feat(v2/sync): implement automatic sync triggering on startup (Phase 2)
michaelgpt Nov 7, 2025
71921f3
feat(v2/sync): add checkpoint/resume functionality (Phase 5.1)
michaelgpt Nov 7, 2025
7dee122
test(v2/sync): add comprehensive unit tests for parallel validation (…
michaelgpt Nov 7, 2025
a21870f
test(v2/sync): add integration tests for checkpoint and parallel vali…
michaelgpt Nov 7, 2025
da54e9b
test(v2/sync): add property tests for parallel validation invariants
michaelgpt Nov 7, 2025
fc86f96
test(v2/sync): add chaos tests for checkpoint and parallel validation…
michaelgpt Nov 7, 2025
29775fb
test(v2/sync): add performance benchmarks for parallel validation
michaelgpt Nov 7, 2025
3e84411
docs(v2/sync): update testing guide for Phase 5 completion
michaelgpt Nov 7, 2025
fb6ec5d
config(eth): add prune and peer throttling configuration
michaelgpt Nov 7, 2025
f4db365
feat(engine): enhance payload validation and fork choice update handling
michaelgpt Nov 10, 2025
1e1913d
fix(update_forkchoice): make sure the execution client state is updat…
michaelgpt Nov 11, 2025
19a45de
feat(sync): fix critical sync detection bugs preventing node startup …
michaelgpt Nov 11, 2025
73fdc71
fix(sync): resolves type error in unit test
michaelgpt Nov 11, 2025
fd2065a
feat(sync): implement state-based bootstrap detection to resolve gene…
michaelgpt Nov 12, 2025
fdb312a
feat(sync): Phase 1 - Arc<RwLock> state refactoring (checkpoint)
michaelgpt Nov 13, 2025
88c3b58
feat(sync): Phase 2 - Handler refactoring complete
michaelgpt Nov 13, 2025
ffcb212
feat(sync): Phase 3 - Remove duplicate methods, achieve clean compila…
michaelgpt Nov 13, 2025
f6b3401
docs(sync): Final status - Architecture refactoring complete
michaelgpt Nov 13, 2025
a005838
feat(sync): Phase 4 - Implement complete block processing with deseri…
michaelgpt Nov 13, 2025
d214db2
fix(sync): remove all unused handlers
michaelgpt Nov 13, 2025
1c8086b
feat(sync): implement production-ready sync features with NetworkActo…
michaelgpt Nov 14, 2025
20cab1a
fix(sync): replace tokio::sync::RwLock with std::sync::RwLock for Act…
michaelgpt Jan 5, 2026
5da3044
fix(sync): wire NetworkActor to SyncActor for late-joining node sync
michaelgpt Jan 6, 2026
517189d
fix(sync): resolve state machine deadlock when target_height=0
michaelgpt Jan 6, 2026
210c4b9
fix(sync): add QueryingNetworkHeight state to fix late-join regression
michaelgpt Jan 6, 2026
adca36c
feat(sync): implement bidirectional block request protocol and orphan…
michaelgpt Jan 6, 2026
4c26ba3
refactor(network): enhance block response logging in NetworkActor
michaelgpt Jan 6, 2026
a60e160
fix(sync): wire SyncActor address to NetworkActor for block forwarding
michaelgpt Jan 6, 2026
a8b1e7f
feat(sync): implement active network height monitoring for desync rec…
michaelgpt Jan 7, 2026
4d56a9d
fix(sync): fix SyncActor/StorageActor height divergence for accurate …
michaelgpt Jan 7, 2026
ab272e8
fix(sync): reduce quorum to 1 and add orphan-triggered re-sync
michaelgpt Jan 7, 2026
d882db1
fix(chain): resolve height sync issues causing node desynchronization
michaelgpt Jan 7, 2026
79259cb
fix(sync): transition ForceResync to QueryingNetworkHeight instead of…
michaelgpt Jan 8, 2026
a85d741
fix(network): relax peer selection criteria for block requests
michaelgpt Jan 8, 2026
34b81dd
feat(network): implement V2 peer reconnection after disconnect
michaelgpt Jan 8, 2026
19d4400
fix(network): preserve connection address instead of identify address
michaelgpt Jan 8, 2026
7450fba
fix(network): filter loopback addresses in mDNS peer discovery
michaelgpt Jan 8, 2026
0ca0051
fix(storage): add graceful shutdown and database recovery
michaelgpt Jan 10, 2026
28d294f
refactor(config): update ChainSpec and Docker configuration for impro…
michaelgpt Jan 10, 2026
8e5ff19
feat(chaos-testing): introduce Alys V2 Chaos Testing Framework
michaelgpt Jan 10, 2026
da92cc6
chore(docker): update port mappings and volume paths in docker-compos…
michaelgpt Jan 10, 2026
3d18cc8
feat(regtest): expand regtest-node-id support from 2 to 10 nodes
michaelgpt Jan 11, 2026
3d29b60
fix(metrics): add alys_ prefix to all metrics for Grafana compatibility
michaelgpt Jan 12, 2026
2407a7b
feat(grafana): add dashboard variables for node filtering
michaelgpt Jan 12, 2026
a0d1610
feat(grafana): add health overview row with at-a-glance stats
michaelgpt Jan 12, 2026
b60b1e1
feat(grafana): add event annotations and specialized monitoring rows
michaelgpt Jan 12, 2026
855d1a4
feat(grafana): add sync state machine panel with value mappings
michaelgpt Jan 12, 2026
ea77f5f
feat(metrics): add per-peer reputation metric and dashboard panel
michaelgpt Jan 12, 2026
a5530a3
feat(peer-manager): integrate per-peer reputation metric updates
michaelgpt Jan 12, 2026
8cba105
fix(metrics): remove redundant alys_ prefix from metric names
michaelgpt Jan 12, 2026
f9c9057
fix(grafana): set explicit datasource UID for dashboard compatibility
michaelgpt Jan 12, 2026
8efa39c
fix(grafana): update dashboard queries to use available metrics
michaelgpt Jan 12, 2026
41bbbf1
feat(chain-actor): improve ChainMetrics registration logging
michaelgpt Jan 12, 2026
1f9c580
fix(grafana): fix node template variable circular query
michaelgpt Jan 12, 2026
ee7bb72
refactor(chain-actor): standardize max_pending_imports constant
michaelgpt Jan 14, 2026
5caf543
feat(metrics): enhance network and sync metrics tracking
michaelgpt Jan 14, 2026
57a8cd1
fix(grafana): correct inverted sync status value mappings
michaelgpt Jan 14, 2026
92adeb8
chore(config): update chain ID to 262626 across multiple configuratio…
michaelgpt Jan 15, 2026
cb1fd21
fix(grafana): update Block Production title and remove unused Sync St…
michaelgpt Jan 15, 2026
536d9c4
fix(docker): update Prometheus metrics port from 9092 to 9093 in dock…
michaelgpt Jan 15, 2026
bf1d965
chore: deleted old knowledge files
michaelgpt Jan 15, 2026
8ef0a2b
feat(docs): add Chain Reorganization status and implementation plan f…
michaelgpt Jan 16, 2026
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
138 changes: 92 additions & 46 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,53 @@
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
branches:
branches:
- main
- development
- 'feature/**'
- 'AN-*'
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main", "development" ]
branches: [ "main", "development", "feature/v2-network" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:
runs-on: anduro-runner
# Select native arch runners per matrix entry
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runs_on: ubuntu-22.04
platform: linux/amd64
- arch: arm64
runs_on: ubuntu-22.04-arm
platform: linux/arm64
runs-on: ${{ matrix.runs_on }}

permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.5.0
- name: Normalize image name to lowercase
run: echo "IMAGE_NAME_LOWER=${IMAGE_NAME,,}" >> $GITHUB_ENV

- name: Normalize image name to lowercase
run: echo "IMAGE_NAME_LOWER=${IMAGE_NAME,,}" >> $GITHUB_ENV

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
# Buildx is still used, but no emulation needed since runners are native
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
Expand All @@ -60,40 +56,90 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6 # v5.0.0
- name: Build and push by digest (${{ matrix.platform }})
id: build
uses: docker/build-push-action@v6
with:
context: .
file: ./etc/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }},push-by-digest=true

- name: Export digest
if: ${{ github.event_name != 'pull_request' }}
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
echo "PLATFORM_SLUG=$(echo '${{ matrix.platform }}' | tr '/' '-')" >> $GITHUB_ENV

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
- name: Upload digest
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_SLUG }}
path: /tmp/digests/*

merge:
if: ${{ github.event_name != 'pull_request' }}
needs: build
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Normalize image name to lowercase
run: echo "IMAGE_NAME_LOWER=${IMAGE_NAME,,}" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download digests
uses: actions/download-artifact@v4
with:
pattern: digests-*
path: /tmp/digests
merge-multiple: true

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LOWER }}

- name: Create and push multi-arch manifest
run: |
tags="${{ steps.meta.outputs.tags }}"
for tag in $tags; do
args=""
for file in /tmp/digests/*; do
args="$args ${tag}@sha256:$(basename "$file")"
done
docker buildx imagetools create -t "$tag" $args
done

- name: Install cosign
uses: sigstore/cosign-installer@v3.5.0

- name: Sign the published Docker images
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}
Loading
Loading