Skip to content

Commit b7a902e

Browse files
committed
fix issues in releases ci
1 parent 02591a3 commit b7a902e

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ jobs:
116116
id: set-version
117117
shell: bash
118118
run: |
119-
VERSION=`cat .version`
120-
NEXT_VERSION=`cat .version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
121-
echo ::set-output name=name::`cat .name`
119+
VERSION=${{ needs.build.outputs.version }}
120+
NEXT_VERSION=`echo $VERSION | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
122121
tmp=$(mktemp)
123122
git config --global user.name 'ProjectBot'
124123
git config --global user.email '[email protected]'
@@ -131,22 +130,24 @@ jobs:
131130
git push
132131
- name: Build package
133132
run: |
134-
npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix
133+
npx vsce package -o ${{ needs.build.outputs.name }}.vsix
135134
- name: Upload Release Asset
136135
id: upload-release-asset
137136
uses: actions/upload-release-asset@v1
138137
env:
139138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140139
with:
141140
upload_url: ${{ github.event.release.upload_url }}
142-
asset_path: ${{ steps.set-version.outputs.name }}.vsix
143-
asset_name: ${{ steps.set-version.outputs.name }}.vsix
141+
asset_path: ${{ needs.build.outputs.name }}.vsix
142+
asset_name: ${{ needs.build.outputs.name }}.vsix
144143
asset_content_type: application/zip
145144
- name: Publish to VSCode Marketplace
145+
shell: bash
146146
run: |
147-
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \
148-
npx vsce publish --packagePath ${{ steps.set-version.outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true
147+
[ -z "${{ secrets.VSCE_TOKEN }}" ] && \
148+
npx vsce publish --packagePath ${{ needs.build.outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true
149149
- name: Publish to Open VSX Registry
150+
shell: bash
150151
run: |
151-
[ -n "${{ secrets.OVSX_TOKEN }}" ] && \
152-
npx ovsx publish ${{ steps.set-version.outputs.name }}.vsix --pat ${{ secrets.OVSX_TOKEN }} || true
152+
[ -z "${{ secrets.OVSX_TOKEN }}" ] && \
153+
npx ovsx publish ${{ needs.build.outputs.name }}.vsix --pat ${{ secrets.OVSX_TOKEN }} || true

0 commit comments

Comments
 (0)