1+ # Run manually to prepare a draft release for the next version of the extension.
2+ # The workflow will create a draft github release where the .vsix can be
3+ # downloaded and manually tested before publishing. To release the version,
4+ # publish the draft release, which will trigger the publish-release workflow.
15name : Draft release
26
37on :
48 workflow_dispatch :
59 inputs :
610 versionBump :
7- description : ' Version bump'
11+ description : " Version bump"
812 type : choice
913 required : true
10- default : ' patch'
14+ default : " patch"
1115 options :
12- - patch
13- - minor
14- - major
15- - exact-version
16+ - patch
17+ - minor
18+ - major
19+ - exact-version
1620
1721 exactVersion :
1822 description : ' Exact version: (Only effective selecting "exact-version" as version bump)'
1923 required : false
2024
21- description : |
22- Run manually to prepare a draft release for the next version of the extension. The workflow will create a draft
23- github release where the .vsix can be downloaded and manually tested before publishing. To release the version,
24- publish the draft release, which will trigger the publish-release workflow.
25-
2625permissions :
2726 contents : write
2827
2928jobs :
3029 prepare-release :
3130 runs-on : ubuntu-latest
31+ outputs :
32+ release-tag : ${{ steps.set-tag.outputs.release-tag }}
3233 steps :
3334 - name : Checkout
3435 uses : actions/checkout@v4
8586 exit 1
8687 fi
8788
88- - name : Run tests and build
89- uses : ./.github/workflows/actions/test-and-build
89+ - name : Set release tag output
90+ id : set-tag
91+ run : echo "release-tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
92+
93+ - name : Upload updated package.json
94+ uses : actions/upload-artifact@v4
95+ with :
96+ name : updated-package-json
97+ path : package.json
98+
99+ build-and-package :
100+ name : Check, Build and Package
101+ runs-on : ubuntu-latest
102+ needs : prepare-release
103+
104+ steps :
105+ - name : Checkout
106+ uses : actions/checkout@v4
107+ with :
108+ fetch-depth : 0
109+
110+ - name : Download updated package.json
111+ uses : actions/download-artifact@v4
112+ with :
113+ name : updated-package-json
114+
115+ - name : Setup Node.js Environment
116+ uses : actions/setup-node@v4
117+ with :
118+ node-version : 22.15.1
119+ cache : npm
120+
121+ - name : Check, build and package
122+ uses : ./.github/workflows/actions/build-and-package
90123 with :
91124 SEGMENT_KEY : ${{ secrets.SEGMENT_KEY_PROD }}
92125 ARTIFACTORY_HOST : ${{ secrets.ARTIFACTORY_HOST }}
@@ -97,9 +130,57 @@ jobs:
97130 SNYK_TOKEN : ${{ secrets.SNYK_TOKEN }}
98131 JIRA_API_TOKEN : ${{ secrets.JIRA_API_TOKEN }}
99132
133+ test :
134+ name : Test
135+ needs : build-and-package
136+
137+ strategy :
138+ matrix :
139+ os : [ubuntu-latest, windows-latest, macos-latest]
140+ fail-fast : false
141+
142+ runs-on : ${{ matrix.os }}
143+
144+ steps :
145+ - name : Checkout
146+ uses : actions/checkout@v4
147+ with :
148+ fetch-depth : 0
149+
150+ - name : Download updated package.json
151+ uses : actions/download-artifact@v4
152+ with :
153+ name : updated-package-json
154+
155+ - name : Setup Node.js Environment
156+ uses : actions/setup-node@v4
157+ with :
158+ node-version : 22.15.1
159+ cache : npm
160+
161+ - name : Run tests
162+ uses : ./.github/workflows/actions/run-tests
163+ with :
164+ SEGMENT_KEY : ${{ secrets.SEGMENT_KEY_PROD }}
165+
166+ create-draft-release :
167+ name : Create Draft Release
168+ runs-on : ubuntu-latest
169+ needs : [prepare-release, test]
170+
171+ steps :
172+ - name : Checkout
173+ uses : actions/checkout@v4
174+
175+ - name : Download VSIX artifact
176+ uses : actions/download-artifact@v4
177+ with :
178+ name : VSIX Package
179+
100180 - name : Create Draft Release
101181 run : |
102182 set -e
183+ RELEASE_TAG="${{ needs.prepare-release.outputs.release-tag }}"
103184 echo Creating draft release for: "${RELEASE_TAG}"
104185 ls *.vsix
105186 ls *.vsix.sig
@@ -114,4 +195,3 @@ jobs:
114195 shell : bash
115196 env :
116197 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
117-
0 commit comments