26262727 with :
2828 run_install : |
29- - args: [--frozen-lockfile]
29+ - args: [--frozen-lockfile]
3030 - name : Cache pnpm modules
3131 uses : actions/cache@v4
3232 env :
@@ -45,69 +45,78 @@ jobs:
4545 - name : Run build
4646 run : pnpm run build
4747 env :
48- NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
48+ NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
4949 - name : Run unit tests
5050 run : pnpm run test --tuiAutoExit
5151 env :
52- NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
52+ NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
5353 - name : Check for changeset files
5454 id : check_changeset_files
5555 uses : andstor/file-existence-action@v3
5656 with :
57- files : ' .changeset/[!README]*.md'
58- fail : false
57+ files : ' .changeset/[!README]*.md'
58+ fail : false
5959 - name : Validate changeset files if found
6060 if : steps.check_changeset_files.outputs.files_exists == 'true'
6161 run : pnpm changeset status
62+ - name : Package SAP Systems VSCode extension
63+ if : steps.check_changeset_files.outputs.files_exists == 'true' && matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
64+ run : |
65+ if grep -R "sap-ux-sap-systems-ext" .changeset/*.md >/dev/null 2>&1; then
66+ echo "sap-systems-ext referenced in changeset. Packaging extension..."
67+ pnpm --filter sap-ux-sap-systems-ext ide-ext:package
68+ else
69+ echo "sap-systems-ext not referenced in changeset. Skipping packaging."
70+ fi
6271 - name : Cache playwright browsers
6372 id : cache-playwright-browsers
6473 uses : actions/cache@v4
6574 with :
66- path : |
67- ${{ runner.os == 'Windows' }}:
68- C:\Users\runneradmin\AppData\Local\ms-playwright
69- ${{ runner.os != 'Windows' }}:
70- ~/.cache/ms-playwright
71- key : playwright-browsers-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
75+ path : |
76+ ${{ runner.os == 'Windows' }}:
77+ C:\Users\runneradmin\AppData\Local\ms-playwright
78+ ${{ runner.os != 'Windows' }}:
79+ ~/.cache/ms-playwright
80+ key : playwright-browsers-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
7281 - name : Install playwright chrome browsers
7382 if : steps.cache-playwright-browsers.outputs.cache-hit != 'true'
7483 run : npx playwright install chrome
7584 - name : Run integration tests
7685 run : pnpm run test:integration
7786 env :
78- NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
87+ NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
7988 - name : Upload playwright reports
8089 if : failure()
8190 uses : actions/upload-artifact@v4
8291 with :
83- name : playwright-reports-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
84- path : |
85- packages/*/playwright-report
86- !packages/*/node_modules
87- retention-days : 15
92+ name : playwright-reports-os-${{ matrix.os }}-node-version-${{ matrix.node-version }}
93+ path : |
94+ packages/*/playwright-report
95+ !packages/*/node_modules
96+ retention-days : 15
8897 - name : Run SonarCloud scan
8998 if : matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
9099 shell : bash
91100 run : |
92- echo ${{ github.event.pull_request.number }} >> pr-event.txt
93- echo ${{ github.event.pull_request.head.ref }} >> pr-event.txt
94- echo ${{ github.event.pull_request.base.ref }} >> pr-event.txt
95-
101+ echo ${{ github.event.pull_request.number }} >> pr-event.txt
102+ echo ${{ github.event.pull_request.head.ref }} >> pr-event.txt
103+ echo ${{ github.event.pull_request.base.ref }} >> pr-event.txt
104+
96105 - name : ' Prepare output artifact'
97106 if : matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
98107 shell : bash
99108 run : touch output.tar && tar --exclude='./node_modules' --exclude='./dist' --exclude='./**/node_modules/**' --exclude='./**/dist/**' --exclude='./.git' --exclude 'output.tar' -czf output.tar .
100-
109+
101110 - name : ' Upload sonar artifact'
102111 if : matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
103112 uses : actions/upload-artifact@v4
104113 with :
105- name : sonar-artifact
106- path : |
107- pr-event.txt
108- output.tar
109- if-no-files-found : error
110- retention-days : 1
114+ name : sonar-artifact
115+ path : |
116+ pr-event.txt
117+ output.tar
118+ if-no-files-found : error
119+ retention-days : 1
111120 version :
112121 # Run version job only on pushes to the main branch. The job depends on completion of the build job.
113122 if : github.repository == 'SAP/open-ux-tools' && github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -124,8 +133,8 @@ jobs:
124133 - name : Setup pnpm
125134126135 with :
127- run_install : |
128- - args: [--frozen-lockfile]
136+ run_install : |
137+ - args: [--frozen-lockfile]
129138 - name : Cache pnpm modules
130139 uses : actions/cache@v4
131140 env :
@@ -170,8 +179,8 @@ jobs:
170179 - name : Setup pnpm
171180172181 with :
173- run_install : |
174- - args: [--frozen-lockfile]
182+ run_install : |
183+ - args: [--frozen-lockfile]
175184 - name : Cache pnpm modules
176185 uses : actions/cache@v4
177186 env :
@@ -190,7 +199,9 @@ jobs:
190199 - name : Replace placeholder with instrumentation key
191200 uses : jacobtomlinson/gha-find-replace@v3
192201 with :
193- include : packages/fiori-mcp-server/src/telemetry/index.ts
202+ include : |
203+ packages/fiori-mcp-server/src/telemetry/index.ts
204+ packages/sap-systems-ext/src/utils/telemetryHelper.ts
194205 find : ' ApplicationInsightsInstrumentationKeyPLACEH0LDER'
195206 replace : ${{ secrets.INSTRUMENTATION_KEY }}
196207 regex : false
@@ -205,20 +216,46 @@ jobs:
205216 publish : pnpm ci:publish
206217 env :
207218 GITHUB_TOKEN : ${{ secrets.ACCESS_PAT }}
208- - name : Prepare Slack notification message
219+ - name : Create GitHub Release (sap-systems-ext)
220+ if : env.SAP_SYSTEMS_EXT_CHANGED == 'true'
221+ uses : softprops/action-gh-release@v1
222+ with :
223+ tag_name : sap-systems-ext@${{ env.EXT_VERSION }}
224+ name : sap-systems-ext v${{ env.EXT_VERSION }}
225+ body : ' VSCode SAP Systems extension v${{ env.EXT_VERSION }} release.'
226+ draft : false
227+ prerelease : false
228+ generate_release_notes : true
229+ files : packages/sap-systems-ext/*.vsix
230+ fail_on_unmatched_files : true
231+ env :
232+ GITHUB_TOKEN : ${{ secrets.ACCESS_PAT }}
233+ - name : Prepare Slack notification message (published packages)
209234 if : steps.changesetPublish.outputs.published == 'true'
210235 run : |
211- # Random delimiter required to support multi-line environment variable value
212- EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
213- echo "PUBLISHED_PACKAGES_MESSAGE<<$EOF" >> $GITHUB_ENV
214- # publishedPackages JSON format: '[{"name": "@sap-ux/axios-extension", "version": "1.0.2"}, {"name": "@sap-ux/fiori-freestyle-writer", "version": "0.15.12"}]'
215- echo "$(echo '${{ steps.changesetPublish.outputs.publishedPackages }}' | jq --raw-output 'map("*" + .name + "*" + " - " + "<https://www.npmjs.com/package/" + .name + "|" + .version + ">") | join("\\n")')" >> $GITHUB_ENV
216- echo "$EOF" >> $GITHUB_ENV
217- - name : Send Slack notification
236+ # Random delimiter required to support multi-line environment variable value
237+ EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
238+ echo "PUBLISHED_PACKAGES_MESSAGE<<$EOF" >> $GITHUB_ENV
239+ # publishedPackages JSON format: '[{"name": "@sap-ux/axios-extension", "version": "1.0.2"}, {"name": "@sap-ux/fiori-freestyle-writer", "version": "0.15.12"}]'
240+ echo "$(echo '${{ steps.changesetPublish.outputs.publishedPackages }}' | jq --raw-output 'map("*" + .name + "*" + " - " + "<https://www.npmjs.com/package/" + .name + "|" + .version + ">") | join("\\n")')" >> $GITHUB_ENV
241+ echo "$EOF" >> $GITHUB_ENV
242+ - name : Prepare Slack notification message (extension release only)
243+ if : steps.changesetPublish.outputs.published != 'true' && env.SAP_SYSTEMS_EXT_CHANGED == 'true'
244+ run : |
245+ echo "EXT_RELEASE_MESSAGE=:package: VSCode SAP Systems extension v${{ env.EXT_VERSION }} released (private package)." >> $GITHUB_ENV
246+ - name : Send Slack notification (published packages)
218247 if : steps.changesetPublish.outputs.published == 'true'
219248220249 with :
221- payload : |
222- {"text": ":rocket: The following packages were published to npmjs.com:\n${{ env.PUBLISHED_PACKAGES_MESSAGE }}" }
250+ payload : |
251+ {"text": ":rocket: The following packages were published to npmjs.com:\n${{ env.PUBLISHED_PACKAGES_MESSAGE }}" }
252+ env :
253+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
254+ - name : Send Slack notification (extension release)
255+ if : steps.changesetPublish.outputs.published != 'true' && env.SAP_SYSTEMS_EXT_CHANGED == 'true'
256+ 257+ with :
258+ payload : |
259+ {"text": "${{ env.EXT_RELEASE_MESSAGE }}" }
223260 env :
224- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
261+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
0 commit comments