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.

55 lines
2.4 KiB

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