您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

48 行
2.0 KiB

  1. name: Publish Stable
  2. on:
  3. push:
  4. tags:
  5. - 'v*.*.*' # Push events to matching v*, i.e. v1.0, v20.15.10
  6. jobs:
  7. build:
  8. name: Publish Stable
  9. runs-on: ubuntu-latest
  10. permissions:
  11. contents: write
  12. steps:
  13. - name: Checkout code
  14. uses: actions/checkout@v3
  15. - name: Setup node
  16. uses: actions/setup-node@v3
  17. with:
  18. node-version: '18'
  19. - name: Setup Environment
  20. run: node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version + '\nPACKAGE_NAME=' + require('./package.json').name + '-' + require('./package.json').version)" >> $GITHUB_ENV
  21. - name: Verify versions
  22. 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')} "
  23. - name: Install
  24. run: yarn
  25. - name: Package extension
  26. run: yarn run package
  27. - name: Publish Extension
  28. run: yarn vsce publish --yarn --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_VSCODE_MARKETPLACE_PAT }}
  29. - name: Generate Changelog
  30. id: changelog
  31. uses: mindsers/changelog-reader-action@v2
  32. with:
  33. version: ${{ env.PACKAGE_VERSION }}
  34. path: ./CHANGELOG.md
  35. - name: Create GitHub release
  36. id: create_release
  37. uses: softprops/action-gh-release@v1
  38. env:
  39. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  40. with:
  41. tag_name: ${{ github.ref }}
  42. name: v${{ env.PACKAGE_VERSION }}
  43. body: ${{ steps.changelog.outputs.changes }}
  44. draft: false
  45. prerelease: false
  46. files: ./${{ env.PACKAGE_NAME }}.vsix