diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..430e908 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,44 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Package Extension + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up npm vsce + run: | + sudo npm install vsce -g + - name: Package extension + run: | + vsce package + ls + VSIXFN=$(ls *.vsix) + echo "vsixfn=${VSIXFN}" >> $GITHUB_ENV + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./${{ env.vsixfn }} + asset_name: ${{ env.vsixfn }} + asset_content_type: application/octet-stream \ No newline at end of file diff --git a/README.md b/README.md index 6dd6ff0..ff44cc3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # TD-VSC +![package](https://github.com/lirc572/TD-VSC/workflows/Package%20Extension/badge.svg) + ## Commands: | Command | Description |