You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.6 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: read
  12. # deployments: write
  13. # packages: write
  14. steps:
  15. - name: Checkout code
  16. uses: actions/checkout@v3
  17. - name: Setup node
  18. uses: actions/setup-node@v3
  19. with:
  20. node-version: '14'
  21. - name: Setup Environment
  22. run: node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version + '\nPACKAGE_NAME=' + require('./package.json').name + '-' + require('./package.json').version)" >> $GITHUB_ENV
  23. - name: Verify versions
  24. 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')} "
  25. - name: Install
  26. run: yarn
  27. - name: Package extension
  28. run: yarn run package
  29. - name: Publish Extension
  30. run: yarn vsce publish --yarn --packagePath ./${{ env.PACKAGE_NAME }}.vsix -p ${{ secrets.GITLENS_VSCODE_MARKETPLACE_PAT }}
  31. - name: Generate Changelog
  32. id: changelog
  33. uses: mindsers/changelog-reader-action@v2
  34. with:
  35. version: ${{ env.PACKAGE_VERSION }}
  36. path: ./CHANGELOG.md
  37. - name: Create GitHub release
  38. id: create_release
  39. # Need to replace with https://github.com/softprops/action-gh-release
  40. uses: actions/create-release@v1
  41. env:
  42. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  43. with:
  44. tag_name: ${{ github.ref }}
  45. release_name: v${{ env.PACKAGE_VERSION }}
  46. body: ${{ steps.changelog.outputs.changes }}
  47. draft: false
  48. prerelease: false
  49. - name: Upload GitHub release
  50. id: upload-release-asset
  51. uses: actions/upload-release-asset@v1
  52. env:
  53. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  54. with:
  55. upload_url: ${{ steps.create_release.outputs.upload_url }}
  56. asset_path: ./${{ env.PACKAGE_NAME }}.vsix
  57. asset_name: ${{ env.PACKAGE_NAME }}.vsix
  58. asset_content_type: application/zip