release #61
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
name: release | |
on: | |
push: | |
branches: | |
- "main" | |
paths-ignore: | |
- ".github/workflows/**" | |
workflow_dispatch: | |
inputs: | |
action: | |
description: Trigger build | |
required: true | |
default: "release" | |
env: | |
BASE_VERSION: 2.0.0 | |
EXTENSION_NAME: Git Config User Profiles | |
EXTENSION_DESC: "Define multiple git config user profiles and switch them easily using status bar" | |
EXTENSION_SLUG: git-config-user-profiles | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' | |
steps: | |
- name: checkout repo with all histrory and tags | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- name: semantic release | |
id: "semantic-release" | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
extra_plugins: | | |
@semantic-release/changelog | |
@semantic-release/github | |
@semantic-release/git | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: "print version" | |
run: echo "New version ${{ steps.semantic-release.outputs.new_release_version }}" | |
- name: 💎 install cached dependencies | |
if: steps.semantic-release.outputs.new_release_version != '' | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: 🚧 install dependencies | |
if: steps.semantic-release.outputs.new_release_version != '' | |
run: npm install | |
- name: 📦 compile and create vsix | |
if: steps.semantic-release.outputs.new_release_version != '' | |
run: npm run package | |
- name: 📤 upload vsix to ovsx | |
if: steps.semantic-release.outputs.new_release_version != '' | |
run: npm run publish:ovsx | |
env: | |
OVSX_PAT: ${{ secrets.OVSX_PAT }} | |
- name: 🚀 publish to marketplace | |
if: success() && steps.semantic-release.outputs.new_release_version != '' | |
run: npm run deploy | |
env: | |
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_PAT }} |