66 - master
77 paths :
88 - ' api.yaml'
9+ - ' express-api.yaml'
910
1011jobs :
1112 generate-release :
@@ -24,17 +25,61 @@ jobs:
2425 with :
2526 node-version-file : .nvmrc
2627
27- - name : Get API specs and generate JSON files
28+ - name : Get Platform API specs and generate JSON files
2829 run : |
2930 PREVIOUS_MERGE=$(git rev-list --merges master | head -n 2 | tail -n 1)
3031 git show $PREVIOUS_MERGE:api.yaml > previous.yaml || echo "v0.0.0" > previous.yaml
31- yq -o=json previous.yaml > previous.json
32-
33- yq -o=json api.yaml > current.json
32+ yq -o=json previous.yaml > previous-platform .json
33+
34+ yq -o=json api.yaml > current-platform .json
3435 rm previous.yaml
3536
36- - name : Run API diff
37- run : node scripts/api-diff.js
37+ - name : Get Express API specs and generate JSON files
38+ run : |
39+ PREVIOUS_MERGE=$(git rev-list --merges master | head -n 2 | tail -n 1)
40+ git show $PREVIOUS_MERGE:express-api.yaml > previous-express.yaml || echo "v0.0.0" > previous-express.yaml
41+ yq -o=json previous-express.yaml > previous-express.json
42+
43+ if [ -f express-api.yaml ]; then
44+ yq -o=json express-api.yaml > current-express.json
45+ else
46+ echo "{}" > current-express.json
47+ fi
48+ rm -f previous-express.yaml
49+
50+ - name : Run Platform API diff
51+ run : node scripts/api-diff.js previous-platform.json current-platform.json platform-release.md
52+
53+ - name : Run Express API diff
54+ run : node scripts/api-diff.js previous-express.json current-express.json express-release.md
55+
56+ - name : Combine release descriptions
57+ run : |
58+ PLATFORM_HAS_CONTENT=false
59+ EXPRESS_HAS_CONTENT=false
60+
61+ if [ -s platform-release.md ]; then
62+ PLATFORM_HAS_CONTENT=true
63+ fi
64+ if [ -s express-release.md ]; then
65+ EXPRESS_HAS_CONTENT=true
66+ fi
67+
68+ # Clear output
69+ > release-description.md
70+
71+ if [ "$PLATFORM_HAS_CONTENT" = true ] && [ "$EXPRESS_HAS_CONTENT" = true ]; then
72+ # Both have content — nest under headers
73+ echo "## Platform API" >> release-description.md
74+ sed 's/^## /### /' platform-release.md >> release-description.md
75+ echo "" >> release-description.md
76+ echo "## Express API" >> release-description.md
77+ sed 's/^## /### /' express-release.md >> release-description.md
78+ elif [ "$PLATFORM_HAS_CONTENT" = true ]; then
79+ cat platform-release.md >> release-description.md
80+ elif [ "$EXPRESS_HAS_CONTENT" = true ]; then
81+ cat express-release.md >> release-description.md
82+ fi
3883
3984 - name : Determine version
4085 id : version
@@ -43,11 +88,11 @@ jobs:
4388 YEAR=$(date +%Y)
4489 MONTH=$(date +%m)
4590 DAY=$(date +%d)
46-
91+
4792 # Get the latest tag for current year.month.day
4893 CURRENT_VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "v$YEAR.$MONTH.$DAY.0")
4994 echo "Current version: $CURRENT_VERSION"
50-
95+
5196 # Extract version number
5297 if [[ $CURRENT_VERSION == v$YEAR.$MONTH.$DAY.* ]]; then
5398 # If we already have a tag for today, increment its number
57102 # If this is the first tag for today, start at .1
58103 NEW_VERSION="v$YEAR.$MONTH.$DAY.1"
59104 fi
60-
105+
61106 echo "New version: $NEW_VERSION"
62107 echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
63108
76121 echo "Release summary is empty, skipping release creation"
77122 exit 0
78123 fi
79-
124+
80125 # Create GitHub Release
81126 gh release create ${{ steps.version.outputs.new_version }} \
82127 --title "${{ steps.version.outputs.new_version }}" \
0 commit comments