Skip to content

πŸ”– Β» release and publish #57

πŸ”– Β» release and publish

πŸ”– Β» release and publish #57

Workflow file for this run

name: πŸ”– Β» release and publish
run-name: πŸ”– Β» release and publish
on:
workflow_dispatch:
inputs:
versionChange:
type: choice
description: Select the version change
required: true
options:
- major
- minor
- patch
jobs:
release:
runs-on: ubuntu-latest
env:
VERSION_CHANGE: ${{ github.event.inputs.versionChange }}
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js βš™οΈ
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- name: Install node_modules πŸ“¦
run: |
npm ci
npm install --global @vscode/vsce
- name: Compile Extension πŸ› οΈ
run: npm run lint && npm run compile && npm run package-web
- name: Generate preview images πŸ–ΌοΈ
run: |
npm run preview
git add images/*.png
- name: Generate contributors image πŸ“Έ
run: |
npm run contributors
git add images/contributors.png
# - name: Optimize SVG files ⚑
# run: |
# npm run svgo
# git add icons/*.svg
- name: Update version β†—
run: |
git status
git config --global user.name 'Lucas Colombo'
git config --global user.email 'lucasncolombo@gmail.com'
git config --global push.followTags true
npm version ${{ env.VERSION_CHANGE }} -m "release: πŸ”– v%s"
- name: Get meta data πŸ”
run: |
NODE_VERSION=$(node -p -e "require('./package.json').version")
echo VERSION=$NODE_VERSION >> $GITHUB_ENV
NODE_NAME=$(node -p -e "require('./package.json').name")
echo NAME=$NODE_NAME >> $GITHUB_ENV
NODE_DISPLAY_NAME=$(node -p -e "require('./package.json').displayName")
echo DISPLAY_NAME=$NODE_DISPLAY_NAME >> $GITHUB_ENV
- name: Build βš’οΈ
run: vsce package
- name: Push tags πŸ“Œ
run: git push
- name: 'release: ${{ env.VERSION }} πŸ”†'
uses: softprops/action-gh-release@v1
with:
files: ${{ env.NAME }}-${{ env.VERSION }}.vsix
tag_name: v${{ env.VERSION }}
name: ${{ env.DISPLAY_NAME }} v${{ env.VERSION }}
generate_release_notes: true
- name: Publish to Open VSX Registry 🌐
uses: HaaLeo/publish-vscode-extension@v1
# disable for now
if: ${{ false }}
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
extensionFile: ${{ env.NAME }}-${{ env.VERSION }}.vsix
- name: Publish to Visual Studio Marketplace πŸš€
uses: HaaLeo/publish-vscode-extension@v1
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ env.NAME }}-${{ env.VERSION }}.vsix
- name: Publish to NPM Registry 🌐
run: npm publish
if: ${{ false }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}