[code] fix double build for dev compiles (#26) #14
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag_version: | |
description: "Tag Version" | |
required: true | |
push: | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-22.04 | |
env: | |
GH_REPO: ${{ github.repository }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 | |
- name: Use Node.JS 18.x | |
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version: 18.x | |
- name: Set Tag Name for Workflow Dispatches | |
run: | | |
TAG_VERSION=${{ github.event.inputs.tag_version }} | |
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV | |
echo "PRERELEASE=--prerelease" >> $GITHUB_ENV | |
if: github.event_name == 'workflow_dispatch' | |
- name: Set Tag Name for Tag Pushes | |
run: | | |
TAG_VERSION=${{ github.ref }} | |
echo "TAG_VERSION=${TAG_VERSION#refs/tags/}" >> $GITHUB_ENV | |
echo "PRERELEASE=" >> $GITHUB_ENV | |
if: github.event_name == 'push' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Set Package Version | |
run: | | |
VERSION=${TAG_VERSION#"v"} | |
sed --in-place 's/"0.0.0"/"'"$VERSION"'"/' package.json | |
sed --in-place 's/"0.0.0"/"'"$VERSION"'"/' azure-devops-extension.json | |
- name: Build Extension | |
run: npm run compile | |
- name: Package Extension | |
run: npm run package-extension | |
- name: Publish Extension | |
run: npm run publish-extension | |
env: | |
AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} | |
if: github.event_name == 'push' | |
- name: Publish Release | |
run: gh release create $TAG_VERSION $PRERELEASE --title $TAG_VERSION --generate-notes --target $GITHUB_SHA *.vsix |