Deploy Package #32
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: Deploy Package | |
on: | |
workflow_dispatch: | |
inputs: | |
level: | |
description: "The level of release to make" | |
required: true | |
type: choice | |
default: "patch" | |
options: | |
- "patch" | |
- "minor" | |
- "major" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "20" | |
- name: Install Dependencies | |
run: | | |
npm install | |
npm install -g @vscode/vsce | |
npm install -g ovsx | |
- name: Set up git user | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
- name: Update schema | |
run: | | |
node ./scripts/getSchemas.js | |
- name: Package | |
run: vsce package ${{ inputs.level }} | |
- name: Deploy to VSMarketplace | |
run: vsce publish -p ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
- name: Deploy to Open VSX | |
run: ovsx publish -p ${{ secrets.OPEN_VSX_TOKEN }} | |
- name: setup variables and update changelog | |
run: | | |
value=$(jq -r '.version' package.json | tr -d '"') | |
echo "VERSION=$value" >> "$GITHUB_ENV" | |
newline="\\n## [${value}] - $(date +'%Y-%m-%d')" | |
sed '/## \[UNRELEASED\]/a\'"$newline" CHANGELOG.md > CHANGELOG.md.tmp | |
mv CHANGELOG.md.tmp CHANGELOG.md | |
- name: Commit | |
run: | | |
git add CHANGELOG.md | |
git commit -m "update changelog" | |
- name: push commit | |
run: | | |
git push origin main | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
release_name: "v${{ env.VERSION }}" | |
body: | | |
See the [changelog](CHANGELOG.md) for details. | |
draft: false | |
prerelease: false |