Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
161 changes: 11 additions & 150 deletions .github/workflows/update-readme-versions.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
name: Sync README component versions
name: Sync component versions

# Propagates the versions of the first entry of stack.yaml to the README, the documentation, and the reference
# Docker Compose deployment. See scripts/sync-stack-versions.py for the updated files.

on:
push:
paths:
- stack.yaml
- scripts/sync-stack-versions.py
workflow_dispatch:

permissions:
contents: write

jobs:
sync-readme-versions:
sync-versions:
runs-on: ubuntu-latest

steps:
Expand All @@ -19,163 +23,20 @@ jobs:
with:
ref: ${{ github.ref_name }}

- name: Parse first stack entry
run: |
set -euo pipefail

awk '
function trim(s) {
sub(/^[[:space:]]+/, "", s)
sub(/[[:space:]]+$/, "", s)
if (length(s) >= 2 && substr(s, 1, 1) == "\"" && substr(s, length(s), 1) == "\"") {
s = substr(s, 2, length(s) - 2)
}
return s
}

BEGIN {
in_stacks = 0
in_first_item = 0
first_item_indent = -1
}

{
line = $0

if (!in_stacks) {
if (line ~ /^[[:space:]]*stacks:[[:space:]]*$/) {
in_stacks = 1
}
next
}

if (!in_first_item) {
if (line ~ /^[[:space:]]*-[[:space:]]*/) {
in_first_item = 1
first_item_indent = index(line, "-") - 1
inline_content = line
sub(/^[[:space:]]*-[[:space:]]*/, "", inline_content)

if (inline_content ~ /^[A-Za-z0-9_-]+[[:space:]]*:/) {
key = inline_content
sub(/:.*/, "", key)
key = trim(key)
value = inline_content
sub(/^[^:]*:[[:space:]]*/, "", value)
sub(/[[:space:]]+#.*/, "", value)
data[key] = trim(value)
}
}
next
}

if (line ~ /^[[:space:]]*-[[:space:]]+/) {
current_indent = index(line, "-") - 1
if (current_indent <= first_item_indent) {
exit
}
}

if (line ~ /^[[:space:]]*[A-Za-z0-9_-]+[[:space:]]*:/) {
key = line
sub(/^[[:space:]]*/, "", key)
sub(/:.*/, "", key)
key = trim(key)

value = line
sub(/^[[:space:]]*[^:]*:[[:space:]]*/, "", value)
sub(/[[:space:]]+#.*/, "", value)
data[key] = trim(value)
}
}

END {
required_keys[1] = "id"
required_keys[2] = "front"
required_keys[3] = "proxy"
required_keys[4] = "charging"
required_keys[5] = "apis"

for (i = 1; i <= 5; i++) {
key = required_keys[i]
if (!(key in data)) {
printf("Missing key in first stack entry: %s\n", key) > "/dev/stderr"
exit 1
}
}

print "STACK_ID=" data["id"]
print "FRONT_VERSION=" data["front"]
print "PROXY_VERSION=" data["proxy"]
print "CHARGING_VERSION=" data["charging"]
print "APIS_VERSION=" data["apis"]
}
' stack.yaml >> "$GITHUB_ENV"

- name: Update README block
run: |
set -euo pipefail

grep -q '^<!-- stack-versions:start -->$' README.md
grep -q '^<!-- stack-versions:end -->$' README.md

cat > /tmp/generated-stack-versions.md <<EOF
### Component versions

The following versions are generated automatically from the first entry in [\`stack.yaml\`](stack.yaml) (\`stacks[0]\`, id \`${STACK_ID}\`):

| Component | Stack key | Version |
|---|---|---|
| Web frontend | \`front\` | \`${FRONT_VERSION}\` |
| Business Ecosystem Logic Proxy | \`proxy\` | \`${PROXY_VERSION}\` |
| Business Ecosystem Charging Backend | \`charging\` | \`${CHARGING_VERSION}\` |
| TMForum APIs | \`apis\` | \`${APIS_VERSION}\` |
EOF

awk '
BEGIN {
start = "<!-- stack-versions:start -->"
end = "<!-- stack-versions:end -->"
in_block = 0
while ((getline line < "/tmp/generated-stack-versions.md") > 0) {
generated = generated line ORS
}
close("/tmp/generated-stack-versions.md")
}

{
if ($0 == start) {
print $0
printf "%s", generated
in_block = 1
next
}

if ($0 == end) {
print $0
in_block = 0
next
}

if (!in_block) {
print $0
}
}
' README.md > README.md.tmp

mv README.md.tmp README.md
- name: Update versions
run: python3 scripts/sync-stack-versions.py

- name: Commit and push changes
run: |
set -euo pipefail

if git diff --quiet README.md; then
echo "README.md already up to date."
if git diff --quiet; then
echo "Versions already up to date."
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git add README.md doc docker/compose
git commit -m "docs: sync component versions from stack.yaml"
git push origin "${{ github.ref_name }}"
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ functionality.

In particular, the Business API Ecosystem is made of the following components:

- Reference implementations of TM Forum APIs.
- FIWARE implementation of the TM Forum APIs, backed by NGSI-LD.

- [TMForum APIs](https://github.com/FIWARE/tmforum-api)

Expand All @@ -60,14 +60,14 @@ In particular, the Business API Ecosystem is made of the following components:
<!-- stack-versions:start -->
### Component versions

The following versions are generated automatically from the first entry in [`stack.yaml`](stack.yaml) (`stacks[0]`, id `2026.10.20`):
The following versions are generated automatically from the first entry in [`stack.yaml`](stack.yaml) (`stacks[0]`, id `2026.12.01`):

| Component | Stack key | Version |
|---|---|---|
| Web frontend | `front` | `2.25.0` |
| Business Ecosystem Logic Proxy | `proxy` | `11.25.0` |
| Business Ecosystem Charging Backend | `charging` | `11.9.1` |
| TMForum APIs | `apis` | `1.15.1` |
| Web frontend | `front` | `3.0.0` |
| Business Ecosystem Logic Proxy | `proxy` | `12.0.0` |
| Business Ecosystem Charging Backend | `charging` | `12.0.0` |
| TMForum APIs | `apis` | `2.2.1` |
<!-- stack-versions:end -->

Any feedback is highly welcome, including bugs, typos or things you think should
Expand All @@ -80,9 +80,9 @@ or

### Description

The Business API Ecosystem is a joint component made up of the FIWARE Business
Framework and a set of APIs (and its reference implementations) provided by the
TMForum. This component allows the monetization of different kind of assets
The Business API Ecosystem combines the FIWARE Business Framework with
[FIWARE's implementation of the TM Forum APIs](https://github.com/FIWARE/tmforum-api).
This component allows the monetization of different kind of assets
(both digital and physical) during the whole service life cycle, from offering
creation to its charging, accounting and revenue settlement and sharing. The
Business API Ecosystem exposes its complete functionality through TMForum
Expand All @@ -102,10 +102,12 @@ You can install the software in two different ways:

## API

For further documentation, you can check the API Reference available at:

- [Apiary](http://docs.fiwaretmfbizecosystem.apiary.io)
- [Github Pages](https://fiware-tmforum.github.io/Business-API-Ecosystem/)
The TM Forum API implementation and its OpenAPI specifications are maintained in
[FIWARE/tmforum-api](https://github.com/FIWARE/tmforum-api). The specifications are
organized by API under [`api/tm-forum/`](https://github.com/FIWARE/tmforum-api/tree/main/api/tm-forum).
Select the release matching the `apis` version in [`stack.yaml`](stack.yaml).
See the [Configuration Guide](doc/configuration-guide.md#configuring-the-tmf-apis)
for the API base paths and their connection to the Logic Proxy and Charging Backend.

## Testing

Expand All @@ -121,9 +123,11 @@ repositories

## Advanced Topics

- [User Guide](doc/user-guide.rst)
- [Programmer Guide](doc/programmer-guide.rst)
- [Installation & Administration Guide](doc/installation-administration-guide.rst)
- [Administrator Guide](doc/admin-guide.md)
- [User Guide](doc/user-guide.md)
- [Data Space Integration Guide](doc/dataspace-guide.md)
- [Plugins Guide](doc/plugins-guide.md)
- [Installation & Administration Guide](doc/installation-administration-guide.md)

You can also find this documentation on
[ReadTheDocs](http://business-api-ecosystem.readthedocs.io)
Expand Down
Loading
Loading