Skip to content

Commit

Permalink
Automate Release process
Browse files Browse the repository at this point in the history
  • Loading branch information
PKief committed Jan 26, 2022
1 parent d135264 commit 80ececd
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release + Publish

on:
workflow_dispatch:
inputs:
versionChange:
type: choice
description: Select the version change
requried: true
options:
- major
- minor
- patch

jobs:
release:
runs-on: ubuntu-latest
env:
VERSION_CHANGE: ${{ github.event.inputs.versionChange }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js ⚙️
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Install node_modules 📦
run: |
npm install
npm install --global vsce
- name: Update version ↗
run: |
git config --global user.name 'Philipp Kief'
git config --global user.email 'PKief@users.noreply.github.com'
git config --global push.followTags true
npm version ${{ env.VERSION_CHANGE }}
- 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
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

0 comments on commit 80ececd

Please sign in to comment.