Skip to content

Commit 5d4a266

Browse files
committed
Refactor config.yml to use repoplone (Closes #14)
1 parent 54d8593 commit 5d4a266

File tree

3 files changed

+49
-21
lines changed

3 files changed

+49
-21
lines changed

.github/workflows/config.yml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: "Compute Config variables"
33
on:
44
workflow_call:
55
inputs:
6-
image-name-prefix:
7-
required: false
8-
type: string
9-
default: "ghcr.io/plonegovbr/social-media"
106
node-version:
117
required: false
128
type: string
@@ -36,7 +32,7 @@ on:
3632
value: ${{ jobs.config.outputs.base-tag }}
3733
image-name-prefix:
3834
description: "Image name prefix for container images"
39-
value: ${{ inputs.image-name-prefix }}
35+
value: ${{ jobs.config.outputs.image-name-prefix }}
4036
node-version:
4137
description: "Node version to be used"
4238
value: ${{ inputs.node-version }}
@@ -60,20 +56,29 @@ jobs:
6056
docs: ${{ steps.filter.outputs.docs }}
6157
frontend: ${{ steps.filter.outputs.frontend }}
6258
base-tag: ${{ steps.vars.outputs.base-tag }}
59+
image-name-prefix: ${{ steps.vars.outputs.image-name-prefix }}
6360
plone-version: ${{ steps.vars.outputs.plone-version }}
6461
volto-version: ${{ steps.vars.outputs.volto-version }}
6562

6663
steps:
6764
- name: Checkout
6865
uses: actions/checkout@v5
6966

67+
- name: Setup uv
68+
uses: plone/meta/.github/actions/setup_uv@2.x
69+
with:
70+
python-version: ${{ inputs.python-version }}
71+
working-directory: '.'
72+
7073
- name: Compute several vars needed for the CI
7174
id: vars
7275
shell: bash
7376
run: |
74-
echo "base-tag=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
75-
echo "plone-version=$(cat backend/version.txt)" >> $GITHUB_OUTPUT
76-
python3 -c 'import json; data = json.load(open("./frontend/mrs.developer.json")); print("volto-version=" + (data["core"].get("tag") or "latest"))' >> $GITHUB_OUTPUT
77+
REPOSITORY_SETTINGS="$(uvx repoplone settings dump)"
78+
echo "image-name-prefix=$(jq -r '.container_images_prefix' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
79+
echo "kc-version=$(jq -r '.backend.base_package_version' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
80+
echo "volto-version=$(jq -r '.frontend.volto_version' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
81+
echo "base-tag=sha-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
7782
7883
- uses: dorny/paths-filter@v3.0.2
7984
id: filter
@@ -99,12 +104,16 @@ jobs:
99104
100105
- name: Test vars
101106
run: |
102-
echo "base-tag: ${{ steps.vars.outputs.base-tag }}"
103-
echo 'plone-version: ${{ steps.vars.outputs.plone-version }}'
104-
echo 'volto-version: ${{ steps.vars.outputs.volto-version }}'
105-
echo 'event-name: ${{ github.event_name }}'
106-
echo 'Paths - acceptance: ${{ steps.filter.outputs.acceptance }}'
107-
echo 'Paths - backend: ${{ steps.filter.outputs.backend }}'
108-
echo 'Paths - devops: ${{ steps.filter.outputs.devops }}'
109-
echo 'Paths - docs: ${{ steps.filter.outputs.docs }}'
110-
echo 'Paths - frontend: ${{ steps.filter.outputs.frontend }}'
107+
echo '# Config Settings' >> $GITHUB_STEP_SUMMARY
108+
echo '| Variable | Value |' >> $GITHUB_STEP_SUMMARY
109+
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
110+
echo "| base-tag | ${{ steps.vars.outputs.base-tag }} |" >> $GITHUB_STEP_SUMMARY
111+
echo "| plone-version | ${{ steps.vars.outputs.plone-version }} |" >> $GITHUB_STEP_SUMMARY
112+
echo "| volto-version | ${{ steps.vars.outputs.volto-version }} |" >> $GITHUB_STEP_SUMMARY
113+
echo "| image-name-prefix | ${{ steps.vars.outputs.image-name-prefix }} |" >> $GITHUB_STEP_SUMMARY
114+
echo "| event-name | ${{ github.event_name }} |" >> $GITHUB_STEP_SUMMARY
115+
echo "| acceptance | ${{ steps.filter.outputs.acceptance }} |" >> $GITHUB_STEP_SUMMARY
116+
echo "| backend | ${{ steps.filter.outputs.backend }} |" >> $GITHUB_STEP_SUMMARY
117+
echo "| devops | ${{ steps.filter.outputs.devops }} |" >> $GITHUB_STEP_SUMMARY
118+
echo "| docs | ${{ steps.filter.outputs.docs }} |" >> $GITHUB_STEP_SUMMARY
119+
echo "| frontend | ${{ steps.filter.outputs.frontend }} |" >> $GITHUB_STEP_SUMMARY

.github/workflows/main.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ on:
55
paths:
66
- "backend/**"
77
- "frontend/**"
8-
- ".github/workflows/backend.yml"
9-
- ".github/workflows/docs.yml"
10-
- ".github/workflows/frontend.yml"
11-
- ".github/workflows/main.yml"
8+
- ".github/workflows/*.yml"
129
- "devops/**"
10+
- "docs/**"
1311
workflow_dispatch:
1412

1513
jobs:
@@ -53,3 +51,23 @@ jobs:
5351
permissions:
5452
contents: read
5553
packages: write
54+
55+
report:
56+
name: "Final report"
57+
if: ${{ always() }}
58+
runs-on: ubuntu-latest
59+
needs:
60+
- config
61+
- backend
62+
- frontend
63+
- docs
64+
steps:
65+
- name: Write report
66+
run: |
67+
echo '# Workflow Report' >> $GITHUB_STEP_SUMMARY
68+
echo '| Job ID | Conclusion |' >> $GITHUB_STEP_SUMMARY
69+
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
70+
echo '| config | ${{ needs.config.result }} |' >> $GITHUB_STEP_SUMMARY
71+
echo '| backend | ${{ needs.backend.result }} |' >> $GITHUB_STEP_SUMMARY
72+
echo '| docs | ${{ needs.docs.result }} |' >> $GITHUB_STEP_SUMMARY
73+
echo '| frontend | ${{ needs.frontend.result }} |' >> $GITHUB_STEP_SUMMARY

news/14.internal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Refactor config.yml to use repoplone. @ericof

0 commit comments

Comments
 (0)