Skip to content

Commit 7c40878

Browse files
committed
Build and publish pre-release Code extension versions
1 parent 0add6e9 commit 7c40878

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

.github/workflows/release.yaml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,24 @@ jobs:
100100
- run: npm ci
101101
working-directory: editors/code
102102

103-
- run: npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
103+
- name: Package Extension (release)
104+
if: github.ref == 'refs/heads/release'
105+
run: npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
106+
working-directory: editors/code
107+
108+
- name: Package Extension (nightly)
109+
if: github.ref != 'refs/heads/release'
110+
run: npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
104111
working-directory: editors/code
105112

106113
- if: matrix.target == 'x86_64-unknown-linux-gnu'
107114
run: rm -rf editors/code/server
108115

109-
- if: matrix.target == 'x86_64-unknown-linux-gnu'
110-
run: npx vsce package -o ../../dist/rust-analyzer.vsix
111-
working-directory: editors/code
116+
- if: matrix.target == 'x86_64-unknown-linux-gnu' && github.ref == 'refs/heads/release'
117+
run: npx vsce package -o ../../dist/rust-analyzer-no-server.vsix
118+
119+
- if: matrix.target == 'x86_64-unknown-linux-gnu' && github.ref != 'refs/heads/release'
120+
run: npx vsce package -o ../../dist/rust-analyzer-no-server.vsix --pre-release
112121

113122
- name: Run analysis-stats on rust-analyzer
114123
if: matrix.target == 'x86_64-unknown-linux-gnu'
@@ -151,7 +160,14 @@ jobs:
151160
- run: npm ci
152161
working-directory: editors/code
153162

154-
- run: npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64
163+
- name: Publish Extension (release)
164+
if: github.ref == 'refs/heads/release'
165+
run: npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64
166+
working-directory: editors/code
167+
168+
- name: Publish Extension (nightly)
169+
if: github.ref != 'refs/heads/release'
170+
run: npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64 --pre-release
155171
working-directory: editors/code
156172

157173
- run: rm -rf editors/code/server
@@ -223,11 +239,19 @@ jobs:
223239
name: ${{ env.TAG }}
224240
token: ${{ secrets.GITHUB_TOKEN }}
225241

242+
- run: rm dist/rust-analyzer-no-server.vsix
243+
226244
- run: npm ci
227245
working-directory: ./editors/code
228246

229-
- name: Publish Extension
247+
- name: Publish Extension (release)
230248
if: github.ref == 'refs/heads/release'
231249
working-directory: ./editors/code
232250
# token from https://dev.azure.com/rust-analyzer/
233251
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
252+
253+
- name: Publish Extension (nightly)
254+
# check specifically for nightly in case someone triggers a release on a feature branch
255+
if: github.ref == 'refs/heads/nightly'
256+
working-directory: ./editors/code
257+
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release

0 commit comments

Comments
 (0)