v0.3.2 #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Publish package to marketplace when a Github release is published | |
# This action checks the tag matches the package version and then publishes the package to the marketplace | |
name: Publish | |
on: | |
release: | |
types: [released] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Match the tag to the package version | |
- name: match-tag-to-package-version | |
id: match-tag-to-package-version | |
uses: geritol/match-tag-to-package-version@0.2.0 | |
with: | |
TAG_PREFIX: v # Optional, default prefix is "" | |
# TAG_PREFIX may also be defined under the 'env' key. | |
# Get the output package name, stripping any v-prefix from the tag | |
- name: Get package name | |
run: | | |
VERSION=${GITHUB_REF_NAME#v} | |
FILENAME="beeb-vsc-$VERSION.vsix" | |
echo Version: $VERSION | |
echo Package: $FILENAME | |
echo "PACKAGE_NAME=$FILENAME" >> $GITHUB_ENV | |
echo "PACKAGE_PATH=./$FILENAME" >> $GITHUB_ENV | |
# Set up Node.js | |
- name: setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
- run: npm ci | |
# Build the package | |
- name: Build | |
run: npm run package | |
# Upload the package artefact to the Github release | |
- name: Upload build artefact | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ${{ env.PACKAGE_PATH }} | |
asset_name: ${{ env.PACKAGE_NAME }} | |
asset_content_type: application/gzip | |
# Publish the package to the marketplace | |
- name: Publish to Visual Studio Marketplace | |
uses: HaaLeo/publish-vscode-extension@v1 | |
with: | |
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
extensionFile: ${{ env.PACKAGE_NAME }} | |
registryUrl: https://marketplace.visualstudio.com | |