@@ -29,67 +29,75 @@ jobs:
2929 FORCE : ${{ github.event.inputs.forcefullyPublish }}
3030 name : Publish Extensions
3131 runs-on : ubuntu-latest
32+ permissions :
33+ actions : write
34+ contents : read
3235 steps :
3336 - uses : actions/checkout@v4
3437 - uses : actions/setup-node@v4.3.0
3538 with :
3639 node-version : " 20.x"
37- - uses : oven-sh/setup-bun@v2
38- with :
39- bun-version : latest
40- - name : Set up pyenv
41- uses : " gabrielfalcao/pyenv-action@32ef4d2c861170ce17ded56d10329d83f4c8f797"
42- with :
43- command : python --version
44- - name : Set default global version
45- run : |
46- pyenv install 3.8
47- pyenv global 3.8
48- - uses : actions/setup-java@v4
49- with :
50- distribution : " microsoft"
51- java-version : " 21"
52- - name : Install dependencies for native modules
53- run : |
54- sudo apt-get update
55- sudo apt-get install libpango1.0-dev libgif-dev
5640 - run : npm install
5741 - run : npm i -g @vscode/vsce pnpm
58- - run : node publish-extensions
42+ - uses : actions/github-script@v7
5943 env :
60- OVSX_PAT : ${{ secrets.OVSX_PAT }}
6144 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62- - name : Report results
63- run : bun run ./report-extensions.ts
64- - uses : actions/upload-artifact@v4
65- if : always()
45+ REPOSITORY : ${{ github.repository }}
6646 with :
67- name : report
68- path : |
69- /tmp/stat.json
70- /tmp/result.md
71- - uses : actions/upload-artifact@v4
72- if : always()
73- with :
74- name : artifacts
75- path : |
76- /tmp/artifacts/*.vsix
77- - name : Upload job summary
78- if : always()
79- run : cat /tmp/result.md >> $GITHUB_STEP_SUMMARY
80- - name : Get previous job's status
81- id : lastrun
82- uses : filiptronicek/get-last-job-status@main
83- - name : Slack Notification
84- if : ${{ !github.event.inputs.extensions && ((success() && steps.lastrun.outputs.status == 'failed') || failure()) }}
85- uses : rtCamp/action-slack-notify@v2
86- env :
87- SLACK_WEBHOOK : ${{ secrets.GITPOD_SLACK_WEBHOOK }}
88- SLACK_COLOR : ${{ job.status }}
47+ script : |
48+ const script = require('./scripts/publish-extensions.js');
49+ await script(async (extension, context) => {
50+ const [owner, repo] = process.env.REPOSITORY.split("/");
51+ await github.request("POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches", {
52+ owner,
53+ repo,
54+ workflow_id: "publish-extension.yml",
55+ ref: "build-extension",
56+ inputs: {
57+ extension: JSON.stringify(extension),
58+ publishContext: JSON.stringify(context),
59+ force: process.env.FORCE,
60+ skipPublish: process.env.SKIP_PUBLISH,
61+ },
62+ headers: {
63+ "X-GitHub-Api-Version": "2022-11-28",
64+ },
65+ });
66+ });
67+ # TODO fix reporting
68+ # - name: Report results
69+ # run: bun run ./report-extensions.ts
70+ # - uses: actions/upload-artifact@v4
71+ # if: always()
72+ # with:
73+ # name: report
74+ # path: |
75+ # /tmp/stat.json
76+ # /tmp/result.md
77+ # - uses: actions/upload-artifact@v4
78+ # if: always()
79+ # with:
80+ # name: artifacts
81+ # path: |
82+ # /tmp/artifacts/*.vsix
83+ # - name: Upload job summary
84+ # if: always()
85+ # run: cat /tmp/result.md >> $GITHUB_STEP_SUMMARY
86+ # - name: Get previous job's status
87+ # id: lastrun
88+ # uses: filiptronicek/get-last-job-status@main
89+ # - name: Slack Notification
90+ # if: ${{ !github.event.inputs.extensions && ((success() && steps.lastrun.outputs.status == 'failed') || failure()) }}
91+ # uses: rtCamp/action-slack-notify@v2
92+ # env:
93+ # SLACK_WEBHOOK: ${{ secrets.GITPOD_SLACK_WEBHOOK }}
94+ # SLACK_COLOR: ${{ job.status }}
8995 check_parity :
9096 name : Check MS parity
9197 runs-on : ubuntu-latest
9298 needs : publish_extensions
99+ permissions :
100+ actions : none
93101 if : ${{ !github.event.inputs.extensions }} # only run on full runs
94102 steps :
95103 - uses : actions/checkout@v4
0 commit comments