Skip to content

Commit

Permalink
feat/vscode: publish vscode extension if a new version is detected (#…
Browse files Browse the repository at this point in the history
…1076)

* feat/vscode: publish vscode extension if a new version is detected

* feat/vscode: update the release instructions in the editors/vscode/RELEASE.md file
  • Loading branch information
Alidra authored Apr 12, 2024
1 parent 01921e0 commit 59faaab
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
npm install -g @types/vscode
npm install -g vsce
make build-vscode-extension
make publish-vscode-extension
env:
PAT: ${{secrets.VSCODE_PAT}}
- name: publish vscode extension
uses: actions/upload-artifact@v4
with:
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,11 @@ uninstall_vim_mode:
.PHONY: build-vscode-extension
build-vscode-extension:
cd editors/vscode && make && mkdir extensionFolder && vsce package -o extensionFolder

.PHONY: publish-vscode-extension
publish-vscode-extension:
ifeq ($(shell vsce show --json deducteam.lambdapi | jq '.versions[0]' | jq '.version'), $(shell cat editors/vscode/package.json | jq '.version'))
echo "extension already exists. Skip"
else
cd editors/vscode && vsce publish -p ${PAT}
endif
13 changes: 12 additions & 1 deletion editors/vscode/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
TODO list for a new release on the VSCode Marketplace
-----------------------------------------------------
**Release from pipeline**

See the details [here](https://code.visualstudio.com/api/working-with-extensions/publishing-extension).
The github DICD pipeline detects the existance of a new version of the Lambdapi extension for Vscode based on the `version` field in the `editors/vscode/package.json` file and publishes it on the Marketplace.

Please note that a valid Azure Personal Access Token (PAT) is required for this operation. This PAT must be saved in the `PAT` environment variable as described [here](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).

If the pipeline fails at publishing the extension, it may be due to the PAT being expired.
Please generate a new one on [Azure](https://dev.azure.com/lambdapi/) and update the `PAT` env variable value as described in the link above.

**manual release**

Though it is not recommanded, it is still possible to manually publish a new version on the marketplace as described bellow
(See the details [here](https://code.visualstudio.com/api/working-with-extensions/publishing-extension)).

- Check the rendering of README.md in some [Markdown viewer](https://codebeautify.org/markdown-viewer). It will be displayed in VSCode by going to extensions
(Ctrl+Shift+X) and by clicking on lambdapi.
Expand Down

0 comments on commit 59faaab

Please sign in to comment.