Skip to content
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

add release action #7

Merged
merged 2 commits into from
Mar 24, 2023
Merged

add release action #7

merged 2 commits into from
Mar 24, 2023

Conversation

jakobhellermann
Copy link
Contributor

Adds a release.yml github actions workflow that builds the server binary and extension for every target listed in https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions.

The action runs on new git tags, and creates a release with all the binaries and vsix, and calls vsce publish.
You'll need to add a VSCE_PAT github secret (how to get access token) and add a publisher field to the package.json.

  • add png version of icon
  • change extension.ts to look for bundled executable first, falls back to typst-lsp[.exe] (could also be configurable via vscode settings)
  • add LICENSE file and package.json properties to addons/vscode
  • add esbuild for bundling and change package.json scripts
    • npm run package builds .vsix, bundles using esbuild minified
    • npm run compile bundles using esbuild with source maps
    • npm run check runs tsc to check typescript
    • npm run lint/lint-fix as before

If you'd like to have anything changed let me know :)

@jakobhellermann
Copy link
Contributor Author

there's also a web target that's not included in this PR. It could disable the language server binary and just provide the grammar/syntax definitions to at least have something.

It would probably also be possible to compile to wasm and run the LSP actions through that, but at that point most people will probably just use typst.app.

@jakobhellermann
Copy link
Contributor Author

The README also should document for the Development cycle that you should move the binary into the addons/vscode/out folder if you want to use the bundled server.

You could also have a vscode task fr that so that ctrl+F5 always compiles extension and server and launches the up-to-date extension.

@nvarner
Copy link
Owner

nvarner commented Mar 23, 2023

I don't have time to fully review this right now, but this looks great! I'll get to it as soon as I can. My biggest concern is actually the name of the project; I'd like to make sure it's okay to call this "Typst LSP" and not "LSP for Typst" or something similar (to avoid looking official when we're not).

@beeb
Copy link
Contributor

beeb commented Mar 24, 2023

Suggesting adding the following to speed up builds:

Incremental builds end up being slower in CI because there is overhead and there wasn't a previous build to base upon.

env:
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  CARGO_INCREMENTAL: '0'

@jakobhellermann
Copy link
Contributor Author

Looks like this is already handled by the rust-toolchain action https://github.com/dtolnay/rust-toolchain/blob/fc3253060d0c959bea12a59f10f8391454a0b02d/action.yml#L89

@beeb
Copy link
Contributor

beeb commented Mar 24, 2023

Oh awesome, I didn't know! Never mind my comment then :)

@nvarner
Copy link
Owner

nvarner commented Mar 24, 2023

This looks good. I'll probably set up a VS Code task like you suggested, so everything "just works".

@nvarner nvarner merged commit 9427d3f into nvarner:master Mar 24, 2023
@jakobhellermann jakobhellermann deleted the publish-ci branch March 24, 2023 19:43
@beeb
Copy link
Contributor

beeb commented Mar 26, 2023

I think the alpine build fails because @vscode/vsce is not installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants