Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
258 commits
Select commit Hold shift + click to select a range
478b98f
docs(scheme): update guide to reflect trait reorganization
ukstv Dec 24, 2025
a6eec22
reqwest example 0
ukstv Dec 24, 2025
5668e4c
wip
ukstv Dec 24, 2025
3f68803
no more X402Scheme
ukstv Dec 24, 2025
17f3eff
wip shit
ukstv Dec 25, 2025
06be51a
wip shit
ukstv Dec 25, 2025
a0f8a0f
wip shit
ukstv Dec 25, 2025
9727689
wip shit
ukstv Dec 25, 2025
bcd887d
wip shit
ukstv Dec 25, 2025
944744e
fuck this shit works
ukstv Dec 25, 2025
d1d3b69
fuck this shit works
ukstv Dec 25, 2025
cb5676a
fuck this shit works
ukstv Dec 25, 2025
d256a4c
feat(eip155): add ChecksummedAddress wrapper for checksummed serializ…
ukstv Dec 25, 2025
dc2296d
feat(eip155): add Into/From trait implementations for ChecksummedAddress
ukstv Dec 25, 2025
0ad5b30
feat(timestamp): add from_secs constructor to UnixTimestamp
ukstv Dec 25, 2025
1013a23
wip
ukstv Dec 25, 2025
1b605b6
refactor(x402): replace client index with direct client reference
ukstv Dec 25, 2025
64905db
refactor(eip155): use Eip155ChainReference for chain ID parsing
ukstv Dec 25, 2025
cf30c6c
refactor(x402): simplify v2 payment processing with typed structs
ukstv Dec 25, 2025
335d4c7
refactor(x402): update v2 imports to use fully qualified module paths
ukstv Dec 25, 2025
26a3e94
refactor(eip155): move ChecksummedAddress to shared types module
ukstv Dec 25, 2025
0554ee5
refactor(eip155): move ChecksummedAddress to shared types module
ukstv Dec 25, 2025
ab5fb1d
refactor(x402): use shared types for payload and requirements
ukstv Dec 25, 2025
39cd920
refactor(eip155): move TokenAmount to shared types module
ukstv Dec 25, 2025
da68d9e
refactor(v2): consolidate PaymentRequired struct and improve code org…
ukstv Dec 25, 2025
d8f1e50
refactor(x402): introduce PaymentCandidateLike trait and generic Paym…
ukstv Dec 25, 2025
0fcd41b
refactor(proto): move PaymentCandidateLike trait to client module
ukstv Dec 25, 2025
b4aabcd
refactor(chain): implement chain pattern priority selection
ukstv Dec 25, 2025
844e739
refactor(proto): move PaymentSelector implementations to client module
ukstv Dec 25, 2025
911bd25
refactor(proto): make resource field required in PaymentRequired and …
ukstv Dec 25, 2025
7cdb3f5
wip
ukstv Dec 26, 2025
76c4113
wip
ukstv Dec 26, 2025
3686bc9
wip
ukstv Dec 26, 2025
5e80007
wip
ukstv Dec 26, 2025
d8a6810
wip
ukstv Dec 26, 2025
429963a
wip
ukstv Dec 26, 2025
cd7ba61
wip
ukstv Dec 26, 2025
91ce5aa
wip
ukstv Dec 26, 2025
8d90c21
wip
ukstv Dec 26, 2025
ce59326
wip
ukstv Dec 26, 2025
a2826b2
wip
ukstv Dec 26, 2025
20cfb1e
wip
ukstv Dec 26, 2025
22f78b9
wip
ukstv Dec 26, 2025
b795a44
wip
ukstv Dec 26, 2025
45eb167
wip
ukstv Dec 26, 2025
48dad24
wip
ukstv Dec 26, 2025
b248a2c
wip
ukstv Dec 26, 2025
696ad9f
wip
ukstv Dec 26, 2025
387b2ed
wip
ukstv Dec 26, 2025
b1f85a8
wip
ukstv Dec 26, 2025
6f3ee95
wip
ukstv Dec 27, 2025
ab91f39
wip
ukstv Dec 27, 2025
fd50052
wip
ukstv Dec 27, 2025
b1ac70d
wip
ukstv Dec 27, 2025
7a4d56c
refactor(examples): move x402 client types to library exports
ukstv Dec 27, 2025
34297a1
chore(examples): add TODO for Solana and other payment schemes
ukstv Dec 27, 2025
579dab9
chore(x402-reqwest): remove deprecated v1 crate directory
ukstv Dec 27, 2025
661596c
feat(scheme): implement v1 EIP-155 exact payment client
ukstv Dec 27, 2025
e4401f3
wip
ukstv Dec 27, 2025
e0c1a98
refactor(scheme): extract shared ERC-3009 signing logic and add dead_…
ukstv Dec 27, 2025
8477d2f
wip
ukstv Dec 27, 2025
d94a735
wip
ukstv Dec 27, 2025
b8b607a
wip
ukstv Dec 27, 2025
fe0dc2a
wip
ukstv Dec 27, 2025
16124a0
solana v2
ukstv Dec 27, 2025
aed5c58
refactor(solana): extract shared transaction building logic into buil…
ukstv Dec 27, 2025
e866e10
refactor(solana): use Arc::clone instead of clone for Arc types
ukstv Dec 27, 2025
962c00d
refactor(solana): make Solana client generic over Signer trait
ukstv Dec 27, 2025
a4f0b9a
refactor(solana): simplify client trait bounds
ukstv Dec 27, 2025
ba38176
refactor(solana): simplify PayloadSigner by removing Arc wrapper
ukstv Dec 27, 2025
746200c
refactor(solana): remove Arc wrapper from V1SolanaExactClient signer
ukstv Dec 27, 2025
14bd393
refactor(solana): make V2SolanaExactClient generic over Signer trait
ukstv Dec 27, 2025
aac4583
refactor(solana): rename rpc parameter to rpc_client
ukstv Dec 27, 2025
9deb1aa
wip
ukstv Dec 27, 2025
6997197
refactor(solana): make V1SolanaExactClient generic over RpcClientLike
ukstv Dec 27, 2025
63e9355
refactor(solana): make V2SolanaExactClient generic over RpcClientLike
ukstv Dec 27, 2025
926f761
refactor(example): consolidate RPC clients and enable V2SolanaExactCl…
ukstv Dec 27, 2025
68f384f
refactor(v1_eip155_exact): use new constructor instead of From trait
ukstv Dec 27, 2025
71215c3
refactor(v1_eip155_exact): add SignerLike trait to support Arc-wrappe…
ukstv Dec 27, 2025
bdfd1aa
wip
ukstv Dec 27, 2025
bf4d55c
refactor(v2_eip155_exact): change From trait to new constructor and a…
ukstv Dec 27, 2025
78d7480
fix(example): update localhost port to 3000
ukstv Dec 27, 2025
8f672af
copy axum-example-0
ukstv Dec 28, 2025
55fa833
wip
ukstv Dec 28, 2025
9f66c49
refactor(example): update x402 axum example with v2 proto types and d…
ukstv Dec 28, 2025
bcd89fd
does not work
ukstv Dec 29, 2025
ee1e384
does not work
ukstv Dec 29, 2025
f2cd63b
compiles
ukstv Dec 29, 2025
5b804d5
compiles
ukstv Dec 29, 2025
df1824a
wip shit
ukstv Dec 29, 2025
9572d07
wip shit
ukstv Dec 29, 2025
3e453f8
wip shit
ukstv Dec 29, 2025
6421d17
move middleware around
ukstv Dec 29, 2025
7b5d399
move middleware around
ukstv Dec 29, 2025
62213a0
wip
ukstv Dec 29, 2025
73979f8
wip
ukstv Dec 29, 2025
ba1afd9
wip
ukstv Dec 29, 2025
9ae972a
wip
ukstv Dec 29, 2025
9e0de2e
wip
ukstv Dec 29, 2025
d7622b0
type level distinction - V1PriceTag
ukstv Dec 29, 2025
8630a44
wip
ukstv Dec 30, 2025
aac1be3
refactor(x402): replace PriceTag with PaymentRequirements in paygate
ukstv Dec 30, 2025
23d6444
feat(x402): implement payment processing pipeline with error handling
ukstv Dec 30, 2025
5006224
feat(x402): add detailed logging and error handling to payment proces…
ukstv Dec 30, 2025
bbbde32
refactor(x402): remove verbose debug logging from payment processing
ukstv Dec 30, 2025
5e25f2e
refactor(x402): simplify payment processing logic and improve code re…
ukstv Dec 30, 2025
038f911
refactor(x402): rename `call` method to `handle_request` and reorder …
ukstv Dec 30, 2025
7b59ff0
refactor(x402): simplify error handling and add telemetry support
ukstv Dec 30, 2025
787ed3b
refactor(x402): simplify settlement error handling and pass payment r…
ukstv Dec 30, 2025
402ab9c
refactor(x402): update proto imports and qualify type references
ukstv Dec 30, 2025
6dfe922
refactor(x402): simplify payment payload type parameters
ukstv Dec 30, 2025
844d20d
refactor(x402): implement direct conversion from VerifyRequest to proto
ukstv Dec 30, 2025
442b1cc
refactor(x402): implement direct conversion from VerifyResponse to proto
ukstv Dec 30, 2025
f5f504a
refactor(x402): simplify settlement flow and make settlement_to_heade…
ukstv Dec 30, 2025
b4b371f
refactor(x402): move call_inner method to generic impl block
ukstv Dec 30, 2025
27202ed
refactor(x402): simplify payment header extraction and payload parsing
ukstv Jan 5, 2026
60d1194
wip
ukstv Jan 6, 2026
d28b50e
refactor(x402): remove commented-out implementation code
ukstv Jan 6, 2026
b3e6eaa
wip
ukstv Jan 6, 2026
3bc1127
wip
ukstv Jan 6, 2026
0cb6fa1
wip
ukstv Jan 6, 2026
5e4a431
refactor(x402): rename error type from X402Error to PaygateError
ukstv Jan 6, 2026
69d9103
wip
ukstv Jan 6, 2026
8a7e9ba
wip
ukstv Jan 6, 2026
1a7971b
wip
ukstv Jan 6, 2026
1872fa8
wip
ukstv Jan 6, 2026
c6e73c7
wip
ukstv Jan 6, 2026
86706f2
wip
ukstv Jan 6, 2026
83f9db6
wip
ukstv Jan 6, 2026
17929f2
wip
ukstv Jan 6, 2026
762a8b7
wip
ukstv Jan 6, 2026
910d510
refactor(x402): wrap fields in Arc for thread safety
ukstv Jan 6, 2026
9909dba
wip
ukstv Jan 6, 2026
a3944ec
wip
ukstv Jan 6, 2026
daca312
wip
ukstv Jan 7, 2026
704737c
wip
ukstv Jan 7, 2026
89a7d29
feat(x402): add settlement before execution option
ukstv Jan 7, 2026
45ce5e5
refactor(x402): reorganize imports and update resource info type
ukstv Jan 7, 2026
b6e9112
refactor(x402): rename paygate2 module to paygate
ukstv Jan 7, 2026
f544ab2
v2 - wip
ukstv Jan 7, 2026
d2767ac
v2 scheme works
ukstv Jan 7, 2026
d71262e
v2 scheme works
ukstv Jan 7, 2026
d81f9d1
refactor(x402): unify paygate implementations with generic PaygatePro…
ukstv Jan 7, 2026
7e05b8f
refactor(x402): consolidate paygate modules into unified implementation
ukstv Jan 7, 2026
2684e3e
feat(x402): add Solana exact payment scheme modules
ukstv Jan 7, 2026
f7f2f22
feat(paygate): enrich price tags with facilitator capabilities dynami…
ukstv Jan 8, 2026
08d990e
feat(axum-example): add Solana payment scheme support
ukstv Jan 8, 2026
4e68186
refactor(axum-example): simplify facilitator URL fallback
ukstv Jan 8, 2026
28b5e1e
feat(axum-example): make max_timeout_seconds configurable in price tags
ukstv Jan 8, 2026
9a15386
feat(axum-example): add protected route with v2 EIP-155 and Solana pa…
ukstv Jan 8, 2026
39b9d2e
refactor(proto): remove V1PriceTag and V2PriceTag type aliases in fav…
ukstv Jan 8, 2026
f09b773
wip
ukstv Jan 8, 2026
6e1aaab
wip
ukstv Jan 8, 2026
8e5ae37
feat(scheme): add builder pattern for V1Eip155ExactPriceTag construction
ukstv Jan 8, 2026
eae02be
refactor(scheme): add price_tag() method for V1SolanaExact
ukstv Jan 8, 2026
f7d42d5
refactor(scheme): replace hardcoded "exact" string with ExactScheme type
ukstv Jan 8, 2026
cdfb94d
refactor(scheme): add price_tag() method for V2Eip155Exact
ukstv Jan 8, 2026
0109eee
refactor(scheme): add price_tag() constructor for V2SolanaExact
ukstv Jan 8, 2026
af8234f
chore(middleware): add TODO for caching timeout feature in facilitato…
ukstv Jan 8, 2026
db89e3c
feat(middleware): redesign axum middleware with simplified X402LayerB…
ukstv Jan 8, 2026
7fc297d
fmt + clippy
ukstv Jan 8, 2026
5eef5f6
refactor(example): simplify RPC client closure to method reference
ukstv Jan 8, 2026
9dbe33d
feat(x402-axum): add TryFrom<String> implementation and update endpoi…
ukstv Jan 8, 2026
2a54aba
docs(x402-axum): add comprehensive documentation to middleware layer
ukstv Jan 8, 2026
6fd7db2
docs(x402-axum): improve module documentation and examples
ukstv Jan 8, 2026
c232bed
docs(x402-axum): improve paygate documentation with overview and fiel…
ukstv Jan 8, 2026
8e5d48e
chore(x402-axum): update http dependency and remove once_cell
ukstv Jan 8, 2026
676c1f4
chore(x402-reqwest): simplify dependencies and remove unused code
ukstv Jan 8, 2026
a737b34
feat(x402-reqwest): inline http_payment_required_from_response and ad…
ukstv Jan 8, 2026
80fec35
docs(x402-reqwest): add comprehensive documentation with examples
ukstv Jan 8, 2026
6489f50
docs(x402-axum, x402-reqwest): restructure documentation and refactor…
ukstv Jan 8, 2026
c60bcf8
chore(x402-rs): remove hidden __reexports module and TODO comment
ukstv Jan 8, 2026
76a5b99
feat(x402-reqwest): add tracing telemetry support
ukstv Jan 8, 2026
15360a0
refactor(x402-reqwest): improve telemetry span naming and add documen…
ukstv Jan 8, 2026
9e2e9c4
refactor(x402-reqwest): add telemetry span for underlying HTTP requests
ukstv Jan 8, 2026
5a51e90
move todo around
ukstv Jan 8, 2026
a3deb88
docs: update README files with protocol v2 announcement and formatting
ukstv Jan 8, 2026
6a02d1b
feat(x402-axum): add TTL cache for facilitator supported endpoint
ukstv Jan 8, 2026
d0b0edb
telemetry for examples
ukstv Jan 8, 2026
4a768a0
chore(x402-axum): remove FIXME comment from facilitator client
ukstv Jan 8, 2026
91bc023
refactor(x402-axum): wrap layer builder fields in Arc for thread safety
ukstv Jan 8, 2026
2539292
wip
ukstv Jan 8, 2026
6ee2c6b
docs(x402-axum): add protocol support and cache TTL documentation
ukstv Jan 8, 2026
84d1d58
refactor(x402-axum): change enrich_with_capabilities to mutable self
ukstv Jan 9, 2026
3d28edb
refactor(scheme): use ExactScheme constant instead of hardcoded string
ukstv Jan 9, 2026
813bc4a
refactor: change v2::PriceTag from type alias to struct wrapper
ukstv Jan 9, 2026
4d087cb
refactor(proto): add Enricher type alias for extensible price tag enr…
ukstv Jan 9, 2026
8ac4de8
refactor(solana): use payment kinds for fee payer enrichment
ukstv Jan 9, 2026
f6d81c2
refactor(v2): implement proper PriceTag to PaymentRequirements compar…
ukstv Jan 9, 2026
5c0f092
feat(solana): add parse method for MoneyAmount conversion
ukstv Jan 9, 2026
559a15a
test(x402-rs): add parse method tests for Eip155TokenDeployment
ukstv Jan 9, 2026
1ae9313
refactor(client): move client types from proto to scheme module
ukstv Jan 9, 2026
0837e90
refactor(proto): simplify JSON handling by replacing RawValue with Value
ukstv Jan 9, 2026
4a5d789
chore(proto): remove FIXME comment from TExtra type
ukstv Jan 9, 2026
8dce1a6
refactor(x402-axum): remove unnecessary trait bound from Paygate impl…
ukstv Jan 10, 2026
26ebbec
feat(x402-axum): add dynamic pricing support via PriceTagSource trait
ukstv Jan 10, 2026
51a9593
refactor(x402-axum): simplify dynamic pricing API with IntoPriceTag t…
ukstv Jan 10, 2026
58e1934
feat(scheme): add identity IntoPriceTag implementations for v1 and v2…
ukstv Jan 10, 2026
e3065f8
refactor(x402-axum): relax trait bounds and rename with_tag to with_p…
ukstv Jan 10, 2026
464a1b1
feat(example): add dynamic pricing route example and u64 TokenAmount …
ukstv Jan 10, 2026
ce8ead7
refactor(scheme): refactor v2_eip155_exact price_tag to return v2::Pr…
ukstv Jan 10, 2026
6ed4140
refactor(scheme): refactor v2_solana_exact price_tag to return v2::Pr…
ukstv Jan 10, 2026
67996ca
refactor(scheme): refactor v1 exact price_tag methods to return v1::P…
ukstv Jan 10, 2026
24702e3
refactor(scheme): remove IntoPriceTag trait and simplify price tag ha…
ukstv Jan 10, 2026
05370be
docs(x402-axum): update custom scheme documentation to reflect simpli…
ukstv Jan 10, 2026
f4502e3
feat(x402-axum): bypass payment enforcement when no price tags config…
ukstv Jan 10, 2026
a532cf5
docs(x402-axum): document dynamic pricing and conditional free access
ukstv Jan 10, 2026
4946f74
docs(x402-axum): update READMEs to reflect v2 protocol support and mu…
ukstv Jan 10, 2026
98d74b6
docs(x402-reqwest): update READMEs to reflect v2 protocol support and…
ukstv Jan 10, 2026
0600aeb
docs: update README to reflect multi-chain support in examples
ukstv Jan 10, 2026
fa93956
docs: add planned features to README
ukstv Jan 10, 2026
5c2b681
docs: update README with v2 protocol and multi-chain examples
ukstv Jan 10, 2026
0fe052a
docs: update README with v2 protocol examples and formatting improvem…
ukstv Jan 10, 2026
f672db2
fix(v1_solana_exact): add mint field to TransferCheckedInstruction an…
ukstv Jan 12, 2026
bd0b05c
style(scheme): apply clippy lints and formatting improvements
ukstv Jan 12, 2026
9ce346b
docs(x402-rs): update README for v1 solana exact scheme
ukstv Jan 12, 2026
513fda0
docs(scheme): clarify facilitator role and fix x402 version reference
ukstv Jan 12, 2026
9d4aa9b
chore: organize workspace dependencies and add serde_with
ukstv Jan 12, 2026
bde0733
fix: use new hyphen-separated id format (#50)
myronrotter Jan 12, 2026
cf8c6b5
docs: format markdown table alignment in README
ukstv Jan 12, 2026
6d260e7
chore: add no-entrypoint features to SPL token dependencies and add t…
ukstv Jan 12, 2026
60f2c1c
docs: remove outdated v2 protocol coming soon notices
ukstv Jan 12, 2026
f61f07d
chore(deps): update example dependencies to use version references
ukstv Jan 12, 2026
6b0cb3f
fix(x402-rs): initialize BlobGasFiller using default constructor
ukstv Jan 12, 2026
b88006c
chore(x402-rs): bump version to 0.11.1
ukstv Jan 12, 2026
3860295
docs: bump to 0.11.2 and add comprehensive module and type documentation
ukstv Jan 12, 2026
105f0ab
chore: remove .env.example file
ukstv Jan 12, 2026
fe1e32b
feat: Add Celo chains (#52)
palango Jan 13, 2026
8ada966
chore(x402-rs): bump version to 0.11.3
ukstv Jan 13, 2026
36ec9fc
fix: register schemes for all chains matching a wildcard pattern (#54)
GuoyemengSmartiful Jan 15, 2026
9fd677f
docs: add doc-comments to ChainRegistry::by_chain_id_pattern
ukstv Jan 15, 2026
f1ec1b5
docs: update code examples and documentation
ukstv Jan 15, 2026
1af6ad2
chore: Bump x402-rs to 0.11.4
ukstv Jan 15, 2026
85ba690
feat(x402-reqwest): add json feature for reqwest-middleware support
ukstv Jan 15, 2026
51ac3aa
build: update base images to trixie and clean up Dockerfile
ukstv Jan 16, 2026
3dd2f29
refactor: Make ChainProvider and scheme facilitators generic over pro…
ukstv Jan 19, 2026
f14e956
chore: bump versions and dependencies for x402 crates
ukstv Jan 19, 2026
8efe409
chore(x402-rs): bump version to 0.12.1 and enhance configuration hand…
ukstv Jan 19, 2026
6ea3b8b
refactor: generalize Solana provider traits and update facilitator in…
ukstv Jan 20, 2026
4b6f0ad
chore(x402-rs): bump version to 0.12.2 - more general Solana provider
ukstv Jan 20, 2026
947e271
chore(x402-rs): bump version to 0.12.3 and enhance provider abstraction
ukstv Jan 20, 2026
67e1862
chore(x402-rs): bump version to 0.12.4 and refine Solana provider
ukstv Jan 20, 2026
e41603e
fix: make `resource_info` optional in V2 PaymentPayload
ukstv Jan 21, 2026
2448c25
feat: Add Aptos support to facilitator
jtang17 Jan 23, 2026
5aff58f
chore: Use git tag instead of commit hash for Aptos dependencies
jtang17 Jan 23, 2026
6b845c3
ci: Add GitHub Actions workflow for building x402-rs images
jtang17 Jan 23, 2026
e408988
feat: Make Aptos transaction sponsorship optional
jtang17 Jan 23, 2026
0346686
docs: Add Aptos config examples for sponsored and non-sponsored modes
jtang17 Jan 23, 2026
a935277
feat: Support environment variables for all Aptos config fields
jtang17 Jan 23, 2026
c24f940
feat: Add optional API key support for Aptos RPC
jtang17 Jan 23, 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
22 changes: 0 additions & 22 deletions .env.example

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build x402-rs Images
on:
workflow_dispatch: # allows manual triggering of workflow via Github UI or CLI
inputs:
git_sha:
description: "The git sha to deploy"
required: true
pull_request: # allows triggering of workflow on PR events. It inherits the permissions of the user that triggers it.
push: # trigger on push to select branches
branches:
- main

# cancel redundant builds
concurrency:
# For `push` and `workflow_dispatch` events we use `github.sha` in the concurrency group and don't really cancel each other out/limit concurrency
# For `pull_request` events newer jobs cancel earlier jobs to save on CI etc.
#
# Variables reference, since it can be a bit tricky to understand: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
# The values that we use and care about here are:
# - github.sha = the commit hash that triggered the workflow. For `push` this is the commit hash of the branch/tag pushed to, and for `workflow_dispatch`, this is the commit hash of the branch that the workflow was triggered from.
# - github.head_ref = source branch of the PR (only for PR triggers)
# - github.ref = the fully-formed git ref that triggered the event. This is a fallback
group: ${{ github.workflow }}-${{ github.event_name }}-${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.sha || github.head_ref || github.ref }}
cancel-in-progress: true

permissions:
id-token: write # required for GCP Workload Identity federation which we use to login into Google Artifact Registry
contents: read # because permissions are manually set due to id-token: write, we need to explicitly set contents: read

env:
# GIT_SHA is used as part of the docker tag / cache key inside our docker-bake.hcl docker bake files.
# The git commit hash is used as a unique identifier for all docker images built from the same commit.
#
# In case of pull_request events, by default github actions merges the PR target branch (e.g. main) into the PR branch and then runs the tests etc
# on the prospective merge result instead of only on the tip of the PR.
# For more info also see https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
GIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

jobs:
build-and-push-images:
runs-on: runs-on,cpu=64,family=c7,hdd=200,image=ubuntu22-full-x64,run-id=${{ github.run_id }}
env:
DOCKER_DEFAULT_PLATFORM: linux/amd64
TARGET_REGISTRY: "us-docker.pkg.dev/aptos-registry/docker/x402-rs"
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.GIT_SHA }} # checkout the commit that triggered the workflow, and for PRs, this is the tip of the PR branch (rather than a merge commit)

# Related setups from our public shared actions repository: https://github.com/aptos-labs/actions
- uses: aptos-labs/actions/docker-setup@main
- uses: aptos-labs/actions/gar-auth@main
with:
# These are variables (not secrets!) that enable us to authenticate with GCP using Workload Identity Federation.
# They are defined here: https://github.com/aptos-labs/actions/settings/variables/actions
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ vars.GCP_WORKLOAD_IDENTITY_PROVIDER }}
GCP_SERVICE_ACCOUNT_EMAIL: ${{ vars.GCP_SERVICE_ACCOUNT_EMAIL }}

- name: Build and Push Images
run: |
docker buildx build --file ./Dockerfile --push --tag $TARGET_REGISTRY:$GIT_SHA \
--cache-from type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }} \
--cache-to type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max \
.
Loading
Loading