Skip to content

Commit 2d9c14a

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

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

.github/workflows/release.yaml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,25 @@ 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
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+
working-directory: editors/code
119+
120+
- if: matrix.target == 'x86_64-unknown-linux-gnu' && github.ref != 'refs/heads/release'
121+
run: npx vsce package -o ../../dist/rust-analyzer-no-server.vsix --pre-release
111122
working-directory: editors/code
112123

113124
- name: Run analysis-stats on rust-analyzer
@@ -151,7 +162,14 @@ jobs:
151162
- run: npm ci
152163
working-directory: editors/code
153164

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

157175
- run: rm -rf editors/code/server
@@ -223,11 +241,19 @@ jobs:
223241
name: ${{ env.TAG }}
224242
token: ${{ secrets.GITHUB_TOKEN }}
225243

244+
- run: rm dist/rust-analyzer-no-server.vsix
245+
226246
- run: npm ci
227247
working-directory: ./editors/code
228248

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

0 commit comments

Comments
 (0)