Fixed Create Release Action #8
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
name: Create Release | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
env: | |
NODE_VERSION: '16' | |
jobs: | |
create_artifact: | |
name: Build tag extension | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
- name: Checkout latest release tag | |
run: | | |
LATEST_TAG=${GITHUB_REF#refs/tags/} | |
git checkout $LATEST_TAG | |
- name: Prepare Artifact Folder | |
run: mkdir -p out/artifact | |
- name: Prepare Package | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- run: | | |
rm -rf node_modules | |
rm yarn.lock | |
yarn cache clean | |
yarn install | |
npm i -g @vscode/vsce | |
- name: Build extension | |
run: | | |
vsce package --yarn -o csharpextension-${GITHUB_REF#refs/tags/}.vsix | |
mv csharpextension-${GITHUB_REF#refs/tags/}.vsix out/artifact/csharpextension-${GITHUB_REF#refs/tags/}.vsix | |
- name: Upload Artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: csharpextension-artifact | |
path: out/artifact | |
draft_release: | |
name: Draft Release | |
runs-on: ubuntu-latest | |
needs: create_artifact | |
if: success() | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Get the pushed tag | |
id: get_tag | |
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/} | |
- name: Download Artifact | |
uses: actions/download-artifact@master | |
with: | |
name: csharpextension-artifact | |
path: out/artifact | |
- name: Create Draft Release | |
id: draft_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: 'out/artifact/csharpextension-${GITHUB_REF#refs/tags/}.vsix' | |
draft: true |