Skip to content

feat: Build and publish pre-release Code extension versions #11071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,25 @@ jobs:
- run: npm ci
working-directory: editors/code

- run: npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
- name: Package Extension (release)
if: github.ref == 'refs/heads/release'
run: npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
working-directory: editors/code

- name: Package Extension (nightly)
if: github.ref != 'refs/heads/release'
run: npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
working-directory: editors/code

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

- if: matrix.target == 'x86_64-unknown-linux-gnu'
run: npx vsce package -o ../../dist/rust-analyzer.vsix
- if: matrix.target == 'x86_64-unknown-linux-gnu' && github.ref == 'refs/heads/release'
run: npx vsce package -o ../../dist/rust-analyzer-no-server.vsix
working-directory: editors/code

- if: matrix.target == 'x86_64-unknown-linux-gnu' && github.ref != 'refs/heads/release'
run: npx vsce package -o ../../dist/rust-analyzer-no-server.vsix --pre-release
working-directory: editors/code

- name: Run analysis-stats on rust-analyzer
Expand Down Expand Up @@ -151,7 +162,14 @@ jobs:
- run: npm ci
working-directory: editors/code

- run: npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64
- name: Publish Extension (release)
if: github.ref == 'refs/heads/release'
run: npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64
working-directory: editors/code

- name: Publish Extension (nightly)
if: github.ref != 'refs/heads/release'
run: npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64 --pre-release
working-directory: editors/code

- run: rm -rf editors/code/server
Expand Down Expand Up @@ -223,11 +241,19 @@ jobs:
name: ${{ env.TAG }}
token: ${{ secrets.GITHUB_TOKEN }}

- run: rm dist/rust-analyzer-no-server.vsix

- run: npm ci
working-directory: ./editors/code

- name: Publish Extension
- name: Publish Extension (release)
if: github.ref == 'refs/heads/release'
working-directory: ./editors/code
# token from https://dev.azure.com/rust-analyzer/
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix

- name: Publish Extension (nightly)
# check specifically for nightly in case someone triggers a release on a feature branch
if: github.ref == 'refs/heads/nightly'
working-directory: ./editors/code
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release
16 changes: 8 additions & 8 deletions editors/code/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"Programming Languages"
],
"engines": {
"vscode": "^1.62.0"
"vscode": "^1.63.0"
},
"enableProposedApi": true,
"scripts": {
Expand All @@ -44,7 +44,7 @@
},
"devDependencies": {
"@types/node": "~14.17.5",
"@types/vscode": "~1.62.0",
"@types/vscode": "~1.63.0",
"@typescript-eslint/eslint-plugin": "^5.5.0",
"@typescript-eslint/parser": "^5.5.0",
"@vscode/test-electron": "^1.6.2",
Expand Down
2 changes: 1 addition & 1 deletion editors/code/src/ast_inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class AstInspector implements vscode.HoverProvider, vscode.DefinitionProv
}
}

private onDidChangeVisibleTextEditors(editors: vscode.TextEditor[]) {
private onDidChangeVisibleTextEditors(editors: readonly vscode.TextEditor[]) {
if (!this.findAstTextEditor()) {
this.setRustEditor(undefined);
return;
Expand Down
2 changes: 1 addition & 1 deletion editors/code/src/lsp_ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export interface SsrParams {
parseOnly: boolean;
textDocument: lc.TextDocumentIdentifier;
position: lc.Position;
selections: lc.Range[];
selections: readonly lc.Range[];
}
export const ssr = new lc.RequestType<SsrParams, lc.WorkspaceEdit, void>('experimental/ssr');

Expand Down