add publish step to gh actions
This commit is contained in:
37
.github/workflows/main.yml
vendored
37
.github/workflows/main.yml
vendored
@@ -58,4 +58,39 @@ jobs:
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: ${{ env.VSIX_PATH }}
|
||||
name: ${{ env.VSIX_NAME }}
|
||||
name: ${{ env.VSIX_NAME }}
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: package
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
name: Release
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "14"
|
||||
- run: npm install
|
||||
- run: npm install -g vsce
|
||||
- run: vsce package
|
||||
- run: echo "VSIX_PATH=$(find . -maxdepth 1 -type f -iname "*.vsix" | head -1)" >> $GITHUB_ENV
|
||||
- run: echo "VSIX_NAME=$(basename $(find . -maxdepth 1 -type f -iname "*.vsix" | head -1))" >> $GITHUB_ENV
|
||||
- uses: actions/create-release@v1
|
||||
id: create_release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
VSCE_PAT: ${{ secrets.VSCE_PAT }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ github.ref }}
|
||||
body: See [CHANGE LOG](https://github.com/maksim77/gitcheck/blob/main/CHANGELOG.md) for details.
|
||||
draft: false
|
||||
prerelease: false
|
||||
- uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ${{ env.VSIX_PATH }}
|
||||
asset_name: ${{ env.VSIX_NAME }}
|
||||
asset_content_type: application/zip
|
||||
- run: vsce publish
|
||||
Reference in New Issue
Block a user