Skip to content

Commit bffc15a

Browse files
authored
Merge pull request #108 from TechnologyEnhancedLearning/refactor-logging
Refactor logging
2 parents 2e26b18 + 806e462 commit bffc15a

File tree

2 files changed

+6
-74
lines changed

2 files changed

+6
-74
lines changed

.github/workflows/dev.yml

Lines changed: 6 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -50,75 +50,6 @@ jobs:
5050
WASMSTATICCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSTATICCLIENT_APPSETTINGS_PRODUCTION }}
5151
WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION }}
5252
WASMSERVERHOST_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOST_APPSETTINGS_PRODUCTION }}
53-
54-
55-
56-
57-
58-
59-
####### qqqq
60-
# 0 not exclusively due to no version bump so check output
61-
# dry release seems not to error 1 qqqq!
62-
# if [ "${STATUS:-0}" -ne 0 ]; then
63-
# echo "in if status 0"
64-
# if echo "$SEMVER_OUTPUT_RAW" | grep -q "There are no relevant changes"; then
65-
# echo "in if no release published"
66-
# # No new version, but we can find the current version
67-
# echo "No new version required getting current version from git tags"
68-
# DEV_SEMVER_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0-version-not-found") # last git tag so if multiple bumps in other branches making package version there will be some discrepancy but the purpose is distinguishing them for dev purposes.
69-
# echo "DEV_SEMVER_VERSION = $DEV_SEMVER_VERSION"
70-
# exit 0 # treat as success code didnt fail there just was no version increment required
71-
# else
72-
# echo "in else no release published"
73-
# exit $STATUS # real error → fail pipeline
74-
# fi
75-
# else
76-
# # Get version include prerelease tag
77-
# # Dry run returns different text DEV_SEMVER_VERSION=$(echo "$OUTPUT" | grep -oP 'Published release \K[^\s]+')
78-
# echo "in else so status was zero for error"
79-
# DEV_SEMVER_VERSION=$(echo "$SEMVER_OUTPUT_RAW" | grep -oP 'Dry run: would publish version \K[^\s]+')
80-
# echo "DEV_SEMVER_VERSION = $DEV_SEMVER_VERSION"
81-
# echo "version change required true"
82-
# # Just because weve been handling errors
83-
# exit 0
84-
# fi
85-
86-
87-
# qqqq - name: Run semantic version (None Blocking)
88-
# run: |
89-
# # If no version is required we can get an error so here we handle it
90-
# set +e
91-
92-
# SEMVER_OUTPUT_RAW=$(npx semantic-release)
93-
# echo "Raw SEMVER_OUTPUT_RAW=$SEMVER_OUTPUT_RAW"
94-
95-
# SEMVER_OUTPUT=$(echo "$SEMVER_OUTPUT_RAW" | grep -oP 'Published release \K[^\s]+')
96-
97-
# # In development, we always package and update the website—even if there’s no version change.
98-
# # This ensures the CI process runs consistently and the latest code is deployed.
99-
# # It's especially useful when squashing commits, as it guarantees the package is still rebuilt and published.
100-
# echo "Packaging and updating the website in development, even without version changes, to ensure consistent CI behavior and updated packages after squashed commits."
101-
102-
# STATUS=$?
103-
# if [ -z "$SEMVER_OUTPUT" ]; then
104-
# SEMVER_OUTPUT=$(echo "$SEMVER_OUTPUT_RAW" | grep -oP 'Found git tag v\K[^\s]+')
105-
# # Note: If Semver falls back to using a Git tag, it will pick the most recent one.
106-
# # This tag may not belong to the current branch, so the result isn't guaranteed to reflect the latest changes on this branch.
107-
# echo "Semver fallback: using latest Git tag, which may not be from the current branch."
108-
# fi
109-
110-
# if [ -z "$SEMVER_OUTPUT" ]; then
111-
# SEMVER_OUTPUT="0.0.0"
112-
# echo "No semantic version or tag, defaulting to 0.0.0 $SEMVER_OUTPUT"
113-
# fi
114-
115-
# # Export the result to the environment
116-
# echo "SEMVER_OUTPUT=$SEMVER_OUTPUT" >> $GITHUB_ENV
117-
# set -e
118-
################
119-
120-
121-
12253

12354
# Now we've done due diligence
12455
# The checks have been allowed to run if the workflow fails so if there a multiple fails we know.
@@ -174,7 +105,8 @@ jobs:
174105
set +e
175106
# Check what's in the output
176107
GREP_NO_CHANGES=$(echo "$SEMVER_OUTPUT_RAW" | grep -q 'There are no relevant changes' && echo "true" || echo "false")
177-
GREP_WOULD_PUBLISH=$(echo "$SEMVER_OUTPUT_RAW" | grep -q 'Dry run: would publish version' && echo "true" || echo "false")
108+
# qqqq GREP_WOULD_PUBLISH=$(echo "$SEMVER_OUTPUT_RAW" | grep -q 'Dry run: would publish version' && echo "true" || echo "false")
109+
GREP_WOULD_PUBLISH=$(echo "$SEMVER_OUTPUT_RAW" | grep -q 'Published release' && echo "true" || echo "false")
178110
echo "GREP_NO_CHANGES=$GREP_NO_CHANGES"
179111
echo "GREP_WOULD_PUBLISH=$GREP_WOULD_PUBLISH"
180112
set -e
@@ -185,15 +117,16 @@ jobs:
185117
echo "No relevant changes found - DEV_SEMVER_VERSION=$DEV_SEMVER_VERSION"
186118
echo "DEV_SEMVER_VERSION=$DEV_SEMVER_VERSION" >> $GITHUB_ENV
187119
# Check if version bump expected
188-
elif echo "$SEMVER_OUTPUT_RAW" | grep -q 'Dry run: would publish version'; then
120+
# qqqq elif echo "$SEMVER_OUTPUT_RAW" | grep -q 'Dry run: would publish version'; then
121+
elif echo "$SEMVER_OUTPUT_RAW" | grep -q 'Published release'; then
189122
# Extract the actual version
190-
DEV_SEMVER_VERSION=$(echo "$SEMVER_OUTPUT_RAW" | grep -oP 'Dry run: would publish version \K[^\s]+' || echo "extract-failed")
123+
DEV_SEMVER_VERSION=$(echo "$SEMVER_OUTPUT_RAW" | grep -oP 'Published release \K[^\s]+' || echo "extract-failed")
191124
echo "Version change detected - DEV_SEMVER_VERSION=$DEV_SEMVER_VERSION"
192125
echo "version change required true"
193126
echo "DEV_SEMVER_VERSION=$DEV_SEMVER_VERSION" >> $GITHUB_ENV
194127
# Fallback
195128
else
196-
echo " ⚠️ Neither 'no changes' nor 'would publish' found. (using fallback)."
129+
echo " ⚠️ Neither 'no changes' nor 'publish version' found. (using fallback)."
197130
DEV_SEMVER_VERSION="$FALLBACK_VERSION"
198131
echo "DEV_SEMVER_VERSION=$DEV_SEMVER_VERSION"
199132
echo "DEV_SEMVER_VERSION=$DEV_SEMVER_VERSION" >> $GITHUB_ENV

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ jobs:
6969
SEMVER_CHANGED=false
7070
echo "Changes do not warrant a version change. gh_pages and packages won't be updated."
7171
echo "semantic-version-change-required=$SEMVER_CHANGED" >> $GITHUB_OUTPUT
72-
echo "Changes do not warrant a version change. gh_pages and packages won't be updated."
7372
# Check if version bump expected
7473
elif echo "$SEMVER_OUTPUT_RAW" | grep -q 'Published release'; then
7574
# Extract the actual version, if it fails here we want to know

0 commit comments

Comments
 (0)