Merge pull request 'codex/release-v3.0.1' (#778) from codex/release-v3.0.1 into main
Some checks are pending
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/billing_documents Pipeline was successful
ci/woodpecker/push/callbacks Pipeline was successful
ci/woodpecker/push/discovery Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/gateway_chsettle Pipeline is running
ci/woodpecker/push/gateway_aurora Pipeline was successful
ci/woodpecker/push/gateway_chain Pipeline was successful
ci/woodpecker/push/gateway_tron Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline is running
ci/woodpecker/push/payments_methods Pipeline was successful
ci/woodpecker/push/payments_quotation Pipeline is running
Some checks are pending
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/billing_documents Pipeline was successful
ci/woodpecker/push/callbacks Pipeline was successful
ci/woodpecker/push/discovery Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/gateway_chsettle Pipeline is running
ci/woodpecker/push/gateway_aurora Pipeline was successful
ci/woodpecker/push/gateway_chain Pipeline was successful
ci/woodpecker/push/gateway_tron Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline is running
ci/woodpecker/push/payments_methods Pipeline was successful
ci/woodpecker/push/payments_quotation Pipeline is running
Reviewed-on: #778
This commit was merged in pull request #778.
This commit is contained in:
9
Makefile
9
Makefile
@@ -35,6 +35,7 @@
|
||||
update \
|
||||
update-backend \
|
||||
update-frontend \
|
||||
release \
|
||||
bump-version \
|
||||
prepare-release \
|
||||
tag-release \
|
||||
@@ -130,8 +131,9 @@ help:
|
||||
@echo " make update Update all dependencies (Go + Flutter)"
|
||||
@echo " make update-backend Update Go dependencies only"
|
||||
@echo " make update-frontend Update Flutter dependencies only"
|
||||
@echo " make bump-version Bump ./version and frontend/pweb/pubspec.yaml"
|
||||
@echo " make prepare-release Bump versions and create the release-prep commit for a PR"
|
||||
@echo " make release Create a release branch, bump versions, commit and push it"
|
||||
@echo " make bump-version Bump ./version, frontend/pweb/pubspec.yaml and interface/api.yaml"
|
||||
@echo " make prepare-release Bump versions and create the release-prep commit on the current branch"
|
||||
@echo " make tag-release Create the local release tag from main after the PR is merged"
|
||||
@echo " make test Run all tests (backend + frontend)"
|
||||
@echo " make test-backend Run Go backend tests only"
|
||||
@@ -143,6 +145,9 @@ help:
|
||||
@echo " make logs SERVICE=dev-ledger"
|
||||
@echo " make rebuild SERVICE=dev-ledger"
|
||||
|
||||
release:
|
||||
@./ci/scripts/common/release_branch.sh
|
||||
|
||||
bump-version:
|
||||
@./ci/scripts/common/bump_version.sh
|
||||
|
||||
|
||||
15
README.md
15
README.md
@@ -132,15 +132,22 @@ Dev secret source:
|
||||
Recommended release preparation:
|
||||
|
||||
```bash
|
||||
./ci/scripts/common/release.sh
|
||||
# push your branch and open a PR
|
||||
make release
|
||||
# open a PR from the pushed release branch
|
||||
# merge the PR to main
|
||||
git checkout main && git pull
|
||||
# verify the dev deployment from main
|
||||
./ci/scripts/common/tag_release.sh
|
||||
# verify the dev deployment from main, then tag the release
|
||||
make tag-release
|
||||
git push origin v$(cat version)
|
||||
```
|
||||
|
||||
If you want to prepare the release commit on the current branch without creating and
|
||||
pushing a release branch, run:
|
||||
|
||||
```bash
|
||||
make prepare-release
|
||||
```
|
||||
|
||||
Manual production release from an already-prepared commit:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -6,6 +6,7 @@ cd "${REPO_ROOT}"
|
||||
|
||||
VERSION_FILE="./version"
|
||||
PUBSPEC_FILE="./frontend/pweb/pubspec.yaml"
|
||||
INTERFACE_API_FILE="./interface/api.yaml"
|
||||
if [[ ! -f "${PUBSPEC_FILE}" && -f "./frontend/pweb/pubspec.yml" ]]; then
|
||||
PUBSPEC_FILE="./frontend/pweb/pubspec.yml"
|
||||
fi
|
||||
@@ -20,6 +21,11 @@ if [[ ! -f "${PUBSPEC_FILE}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f "${INTERFACE_API_FILE}" ]]; then
|
||||
echo "[bump-version] missing ${INTERFACE_API_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
current_version="$(tr -d '[:space:]' < "${VERSION_FILE}")"
|
||||
if [[ -z "${current_version}" ]]; then
|
||||
echo "[bump-version] ${VERSION_FILE} is empty" >&2
|
||||
@@ -44,6 +50,23 @@ if [[ -z "${current_pubspec_version}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
current_interface_version="$(
|
||||
awk '
|
||||
/^info:[[:space:]]*$/ { in_info = 1; next }
|
||||
in_info && /^[[:space:]]+version:[[:space:]]*/ {
|
||||
sub(/^[[:space:]]+version:[[:space:]]*/, "", $0)
|
||||
print
|
||||
exit
|
||||
}
|
||||
in_info && /^[^[:space:]]/ { in_info = 0 }
|
||||
' "${INTERFACE_API_FILE}"
|
||||
)"
|
||||
|
||||
if [[ -z "${current_interface_version}" ]]; then
|
||||
echo "[bump-version] could not find info.version in ${INTERFACE_API_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_number=0
|
||||
if [[ "${current_pubspec_version}" == *+* ]]; then
|
||||
build_number="${current_pubspec_version##*+}"
|
||||
@@ -58,8 +81,9 @@ next_build_number=$((build_number + 1))
|
||||
|
||||
version_tmp="${VERSION_FILE}.tmp.$$"
|
||||
pubspec_tmp="${PUBSPEC_FILE}.tmp.$$"
|
||||
interface_tmp="${INTERFACE_API_FILE}.tmp.$$"
|
||||
cleanup() {
|
||||
rm -f "${version_tmp}" "${pubspec_tmp}"
|
||||
rm -f "${version_tmp}" "${pubspec_tmp}" "${interface_tmp}"
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
@@ -79,11 +103,36 @@ awk -v version="${new_version}" -v build="${next_build_number}" '
|
||||
}
|
||||
' "${PUBSPEC_FILE}" > "${pubspec_tmp}"
|
||||
|
||||
awk -v version="${new_version}" '
|
||||
BEGIN { in_info = 0; updated = 0 }
|
||||
/^info:[[:space:]]*$/ {
|
||||
in_info = 1
|
||||
print
|
||||
next
|
||||
}
|
||||
in_info && /^[[:space:]]+version:[[:space:]]*/ && !updated {
|
||||
print " version: " version
|
||||
updated = 1
|
||||
next
|
||||
}
|
||||
in_info && /^[^[:space:]]/ {
|
||||
in_info = 0
|
||||
}
|
||||
{ print }
|
||||
END {
|
||||
if (!updated) {
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
' "${INTERFACE_API_FILE}" > "${interface_tmp}"
|
||||
|
||||
mv "${version_tmp}" "${VERSION_FILE}"
|
||||
mv "${pubspec_tmp}" "${PUBSPEC_FILE}"
|
||||
mv "${interface_tmp}" "${INTERFACE_API_FILE}"
|
||||
|
||||
echo "===================================="
|
||||
echo "Release version bumped"
|
||||
echo "===================================="
|
||||
echo "version: ${current_version} -> ${new_version}"
|
||||
echo "${PUBSPEC_FILE}: ${current_pubspec_version} -> ${new_version}+${next_build_number}"
|
||||
echo "${INTERFACE_API_FILE}: ${current_interface_version} -> ${new_version}"
|
||||
|
||||
@@ -6,6 +6,7 @@ cd "${REPO_ROOT}"
|
||||
|
||||
VERSION_FILE="./version"
|
||||
PUBSPEC_FILE="./frontend/pweb/pubspec.yaml"
|
||||
INTERFACE_API_FILE="./interface/api.yaml"
|
||||
if [[ ! -f "${PUBSPEC_FILE}" && -f "./frontend/pweb/pubspec.yml" ]]; then
|
||||
PUBSPEC_FILE="./frontend/pweb/pubspec.yml"
|
||||
fi
|
||||
@@ -24,7 +25,7 @@ require_clean_worktree
|
||||
new_version="$(tr -d '[:space:]' < "${VERSION_FILE}")"
|
||||
release_tag="v${new_version}"
|
||||
|
||||
git add "${VERSION_FILE}" "${PUBSPEC_FILE}"
|
||||
git add "${VERSION_FILE}" "${PUBSPEC_FILE}" "${INTERFACE_API_FILE}"
|
||||
git commit -m "chore: prepare release ${release_tag}"
|
||||
|
||||
echo
|
||||
|
||||
65
ci/scripts/common/release_branch.sh
Executable file
65
ci/scripts/common/release_branch.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
cd "${REPO_ROOT}"
|
||||
|
||||
VERSION_FILE="./version"
|
||||
REMOTE_NAME="${RELEASE_REMOTE:-origin}"
|
||||
|
||||
require_clean_worktree() {
|
||||
if ! git diff --quiet --ignore-submodules -- || ! git diff --cached --quiet --ignore-submodules --; then
|
||||
echo "[release-branch] working tree is not clean; commit or stash changes before creating a release branch" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ ! -f "${VERSION_FILE}" ]]; then
|
||||
echo "[release-branch] missing ${VERSION_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
require_clean_worktree
|
||||
|
||||
current_branch="$(git symbolic-ref --short -q HEAD || true)"
|
||||
if [[ -z "${current_branch}" ]]; then
|
||||
echo "[release-branch] detached HEAD is not supported; checkout a branch first" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! git remote get-url "${REMOTE_NAME}" >/dev/null 2>&1; then
|
||||
echo "[release-branch] remote ${REMOTE_NAME} does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
current_version="$(tr -d '[:space:]' < "${VERSION_FILE}")"
|
||||
if [[ -z "${current_version}" ]]; then
|
||||
echo "[release-branch] ${VERSION_FILE} is empty" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
next_version="$(printf '%s\n' "${current_version}" | awk -F. -v OFS=. '
|
||||
NF == 1 { print ++$NF; next }
|
||||
{ $NF = sprintf("%0*d", length($NF), ($NF + 1)); print }
|
||||
')"
|
||||
|
||||
release_branch="codex/release-v${next_version}"
|
||||
|
||||
if [[ "${current_branch}" != "${release_branch}" ]]; then
|
||||
if git show-ref --verify --quiet "refs/heads/${release_branch}"; then
|
||||
echo "[release-branch] local branch ${release_branch} already exists" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git checkout -b "${release_branch}"
|
||||
fi
|
||||
|
||||
"${REPO_ROOT}/ci/scripts/common/release.sh"
|
||||
git push -u "${REMOTE_NAME}" "${release_branch}"
|
||||
|
||||
echo
|
||||
echo "Release branch ${release_branch} pushed to ${REMOTE_NAME}"
|
||||
echo "Next steps:"
|
||||
echo " 1. open a PR from ${release_branch}"
|
||||
echo " 2. merge the PR to main"
|
||||
echo " 3. checkout main, pull, then run make tag-release"
|
||||
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 3.0.0+605
|
||||
version: 3.0.1+778
|
||||
|
||||
environment:
|
||||
sdk: ^3.8.1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: Sendico Payment API Contract
|
||||
version: 3.0.0
|
||||
version: 3.0.1
|
||||
summary: Minimal client contract for payment execution flows via BFF.
|
||||
description: |
|
||||
OpenAPI 3.1 contract focused on flows required to perform payments:
|
||||
|
||||
Reference in New Issue
Block a user