Skip to content

Commit

Permalink
ci: add workflow for release
Browse files Browse the repository at this point in the history
  • Loading branch information
serg3295 committed Dec 22, 2023
1 parent f51479d commit 680eb69
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for release'
required: false
default: test
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
build_vsix:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci

- name: Setup Environment
run: node -e "console.log('PKG_VERSION=' + require('./package.json').version + '\nPKG_NAME=' + require('./package.json').name + '-' + require('./package.json').version)" >> $GITHUB_ENV

- name: Verify versions
run: node -e "if ('refs/tags/v' + '${{ env.PKG_VERSION }}' !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + '${{ env.PKG_VERSION }}', '${{ github.ref }}'); throw Error('Version Mismatch')} "

- name: Pack vsix
shell: bash
run: |
npm install -g @vscode/vsce
vsce package -o ${{ env.PKG_NAME }}.vsix
- name: Create GitHub release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
files: ${{ env.PKG_NAME }}.vsix

0 comments on commit 680eb69

Please sign in to comment.