2727 - uses : actions/checkout@v5
2828 with :
2929 fetch-depth : 0
30- # Use the app token for checkout as well
3130 token : ${{ secrets.APP_INSTALLATION_TOKEN }}
3231 - name : git config
3332 run : |
3938 node-version : 20
4039 cache : npm
4140
42- # Install dependencies from root (same as backend pipeline)
4341 - name : Install dependencies
4442 run : |
4543 npm ci || {
@@ -58,41 +56,43 @@ jobs:
5856 - name : Gateway Lint
5957 working-directory : services/gateway
6058 run : npm run lint
61-
59+
6260 - name : Prepare release
6361 working-directory : services/gateway
6462 env :
6563 GITHUB_TOKEN : ${{ secrets.APP_INSTALLATION_TOKEN }}
66- TYPE_ARG : ${{ fromJSON('{"patch":"patch", "minor":"minor", "major":"major"}')[github.event.inputs.type] }}
6764 BETA_ARG : ${{ github.event.inputs.beta == 'true' && '--preRelease=beta' || '' }}
68- run : npm run release -- $TYPE_ARG --ci --verbose --no-git.push --no-git.commit --no-git.tag --no-github --no-git.requireCleanWorkingDir $BETA_ARG
65+ TYPE_ARG : ${{ github.event.inputs.type != 'patch' && format('--increment={0}', github.event.inputs.type) || '' }}
66+ run : |
67+ # Let release-it handle version detection and incrementing properly
68+ npm run release -- $TYPE_ARG --ci --verbose --no-git.push --no-git.commit --no-git.tag --no-github --no-git.requireCleanWorkingDir $BETA_ARG
69+
6970 - name : Stage package.json changes
7071 working-directory : services/gateway
7172 run : |
72- # Stage the updated package.json and CHANGELOG.md
7373 git add package.json CHANGELOG.md
74+
7475 - name : Update version.ts file
7576 working-directory : services/gateway
7677 run : |
7778 node scripts/update-version.js || echo "Version update script not found, skipping"
7879 if [ -f src/config/version.ts ]; then
7980 git add src/config/version.ts
8081 fi
82+
8183 - name : get-npm-version
8284 id : package-version
8385 uses : martinbeentjes/npm-get-version-action@main
8486 with :
8587 path : services/gateway
88+
8689 - name : Extract release notes
8790 id : extract-release-notes
8891 run : |
89- # Get the current version from the package.json in the current working directory
9092 VERSION=$(cat package.json | grep '"version"' | cut -d'"' -f4)
9193 echo "Extracting release notes for version $VERSION"
9294
93- # Extract the changelog section for this version
9495 if [ -f CHANGELOG.md ]; then
95- # Look for the version header and extract content until the next version or end of file
9696 RELEASE_NOTES=$(awk -v version="$VERSION" '
9797 BEGIN { found=0; content="" }
9898 /^##? [0-9]+\.[0-9]+\.[0-9]+/ {
@@ -104,10 +104,8 @@ jobs:
104104 END { print content }
105105 ' CHANGELOG.md)
106106
107- # Remove empty lines
108107 CLEAN_NOTES=$(echo "$RELEASE_NOTES" | sed '/^$/d')
109108
110- # Save to output
111109 echo "release_notes<<EOF" >> $GITHUB_OUTPUT
112110 echo "$CLEAN_NOTES" >> $GITHUB_OUTPUT
113111 echo "EOF" >> $GITHUB_OUTPUT
@@ -119,11 +117,11 @@ jobs:
119117 echo "release_notes=" >> $GITHUB_OUTPUT
120118 fi
121119 working-directory : services/gateway
120+
122121 - name : Create pull request
123122 uses : peter-evans/create-pull-request@v7
124123 id : cpr
125124 with :
126- # This is the key change - use the app token
127125 token : ${{ secrets.APP_INSTALLATION_TOKEN }}
128126 branch : gateway-release
129127 delete-branch : true
@@ -154,6 +152,7 @@ jobs:
154152 release
155153 automated pr
156154 draft : false
155+
157156 - name : Show PR link
158157 if : ${{ steps.cpr.outputs.pull-request-url }}
159158 run : |
0 commit comments