Skip to content

Commit

Permalink
Vscode : fix secret name. add Condition on branch before publishing e…
Browse files Browse the repository at this point in the history
…xtension
  • Loading branch information
Alidra committed May 13, 2024
1 parent d38b63e commit 9f956eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
make build-vscode-extension
make publish-vscode-extension
env:
PAT: ${{secrets.VSCODE_PAT}}
PAT: ${{secrets.PAT}}
- name: publish vscode extension
uses: actions/upload-artifact@v4
with:
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,22 @@ JQ = $(shell which jq)
ifneq ($(VSCE),)
ifneq ($(JQ),)
EXT = $(shell vsce show --json deducteam.lambdapi 2>/dev/null | jq '.versions[0]' | jq '.version')

.PHONY: publish-vscode-extension
publish-vscode-extension:
ifeq ($(EXT), $(shell cat editors/vscode/package.json | jq '.version'))
echo "extension already exists. Skip"
else
ifeq ($(PAT),)
echo "The \"PAT\" secret is not set. Please add a secret named \"PAT\" to be able to publish the Vscode extension."
else
ifeq ('master', $(GITHUB_REF_NAME))
cd editors/vscode && vsce publish -p ${PAT}
else
echo "Env Variable \"GITHUB_REF_NAME\" is set to \"$(GITHUB_REF_NAME)\". Please set it to \"master\" to force publishing the extension"
endif
endif
endif

endif
endif

0 comments on commit 9f956eb

Please sign in to comment.