chore: release v2.0.1 #32
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: Publish Extension | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
publish: | |
name: Publish Extension | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Setup Environment | |
run: node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version + '\nPACKAGE_NAME=' + require('./package.json').name + '-' + require('./package.json').version)" >> $GITHUB_ENV # set PACKAGE_VERSION and PACKAGE_NAME | |
- name: Verify Version | |
run: node -e "if ('refs/tags/v' + '${{ env.PACKAGE_VERSION }}' !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + '${{ env.PACKAGE_VERSION }}', '${{ github.ref }}'); throw Error('Version Mismatch')} " | |
- name: Install Dependencies | |
run: | | |
npm install pnpm -g | |
pnpm install --no-frozen-lockfile | |
- name: Package Extension | |
run: pnpm run package | |
- name: Publish Extension | |
run: pnpm run publish --packagePath ./${{ env.PACKAGE_NAME }}.vsix --pat ${{ secrets.TSWAGGER_PERSONAL_ACCESS_TOKEN }} | |
- name: Generate Changelog | |
id: changelog | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
version: ${{ env.PACKAGE_VERSION }} | |
path: ./CHANGELOG.md | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
name: v${{ env.PACKAGE_VERSION }} | |
body: ${{ steps.changelog.outputs.changes }} | |
draft: false | |
prerelease: false | |
files: ./${{ env.PACKAGE_NAME }}.vsix | |
- name: Dingtalk Notify | |
uses: zcong1993/actions-ding@master | |
with: | |
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN}} | |
body: | | |
{ | |
"msgtype": "markdown", | |
"markdown": { | |
"title":"👏👏 TSwagger Release Successful", | |
"text": "### vscode-tswagger \n\n**tswagger@${{ env.PACKAGE_VERSION }}** had been published. You can see it on the [market](https://marketplace.visualstudio.com/items?itemName=OrcaTeam.tswagger)(might take a few minutes). \n\n**These are the changes:**\n\n${{ steps.changelog.outputs.changes }}" | |
}, | |
"at": { | |
"isAtAll": false | |
} | |
} |