Skip to content

Commit 7a41c85

Browse files
committed
Update publish.yml
1 parent 038f8bf commit 7a41c85

File tree

1 file changed

+13
-27
lines changed

1 file changed

+13
-27
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,35 @@ jobs:
2424
TAG_PREFIX: v # Optional, default prefix is ""
2525
# TAG_PREFIX may also be defined under the 'env' key.
2626

27-
- name: Build
28-
run: npm run package
29-
30-
- name: GitHub Tag Name
31-
# ${GITHUB_REF_NAME#v}
32-
run: |
33-
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
34-
echo "Tag name from github.ref_name: ${{ github.ref_name }}"
35-
36-
- name: Extract version from tag
37-
id: version
38-
uses: actions/github-script@0.2.0
39-
with:
40-
github-token: ${{ secrets.GITHUB_TOKEN }}
41-
script: |
42-
return context.ref.replace(/\/refs\/tags\//, '').replace('v', '')
43-
44-
- name: Echo2
45-
run: echo ${{ steps.version.outputs.result }}
46-
47-
48-
# Store the version, stripping any v-prefix
49-
- name: Write release version
27+
# Get the package name, stripping any v-prefix from the tag
28+
- name: Get package name
5029
run: |
5130
VERSION=${GITHUB_REF_NAME#v}
31+
FILENAME="beeb-vsc-$VERSION.vsix"
5232
echo Version: $VERSION
53-
echo "VERSION=$VERSION" >> $GITHUB_ENV
33+
echo Package: $PACKAGE_NAME
34+
35+
echo "PACKAGE_NAME=$FILENAME" >> $GITHUB_ENV
36+
echo "PACKAGE_PATH=./$FILENAME" >> $GITHUB_ENV
37+
38+
- name: Build
39+
run: npm run package
5440

5541
- name: Upload build artefact
5642
uses: actions/upload-release-asset@v1
5743
env:
5844
GITHUB_TOKEN: ${{ github.token }}
59-
PACKAGE_VERSION: ${{ format('beeb-vsc-{0}.vsix', env.VERSION) }}
6045
with:
6146
upload_url: ${{ github.event.release.upload_url }}
62-
asset_path: ${{ format('{0}{1}', './', env.PACKAGE_VERSION) }}
63-
asset_name: ${{ env.PACKAGE_VERSION }}
47+
asset_path: ${{ env.PACKAGE_PATH }}
48+
asset_name: ${{ env.PACKAGE_NAME }}
6449
asset_content_type: application/gzip
6550

6651

6752
- name: Publish to Visual Studio Marketplace
6853
uses: HaaLeo/publish-vscode-extension@v1
6954
with:
7055
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
56+
packagePath: ${{ env.PACKAGE_PATH }}
7157
registryUrl: https://marketplace.visualstudio.com
7258

0 commit comments

Comments
 (0)