Skip to content

Commit

Permalink
Vscode : publish extension. make messages more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
Alidra committed May 14, 2024
1 parent fc0ef39 commit bc12c00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
make publish-vscode-extension
env:
PAT: ${{ secrets.VSCODE_PAT }}
- name: publish vscode extension
- name: upload vscode extension
uses: actions/upload-artifact@v4
with:
name: assets-for-download
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,18 @@ publish-vscode-extension:
ifeq ($(EXT), $(shell cat editors/vscode/package.json | jq '.version'))
echo "extension already exists. Skip"
else
echo "repo name is $(GITHUB_REPOSITORY)"
ifeq ($(PAT),)
echo "The \"PAT\" secret is not set. Please add a secret named \"PAT\" to be able to publish the Vscode extension."
# Note, when pushing code from a fork of the Lambdapi repository, PAT secret is not "reachable".
# The extension is only published when merge occurs.
echo "The \"PAT\" secret is not set. Please check a PAT exists with permissions to publish to Vscode market"
else
ifeq ('master', $(GITHUB_REF_NAME))
# The extension is only published when code is pushed to master to avoid publishing from feature branches
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"
echo "Env Variable \"GITHUB_REF_NAME\" is set to \"$(GITHUB_REF_NAME)\"."
echo "Extension will only be published when pushing to master."
echo "If used manualy, please set Variable \"GITHUB_REF_NAME\" to \"master\" to force publishing the extension"
endif
endif
endif
Expand Down

0 comments on commit bc12c00

Please sign in to comment.