Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI
on:
release:
types:
- released
jobs:
publish:
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
with:
ref: master
token: ${{ secrets.TOKEN }}
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Prepare build
id: set-version
run: |
VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/}
NEXT_VERSION=`echo $VERSION | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
tmp=$(mktemp)
git config --global user.name 'ProjectBot'
git config --global user.email 'bot@users.noreply.github.com'
jq --arg version "${NEXT_VERSION}-SNAPSHOT" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
git add package.json
git commit -m 'auto bump version with release'
git push
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json
NAME=$(jq -r '.name' package.json)-$VERSION
echo ::set-output name=name::$NAME
mkdir dist
npx vsce package -o $NAME.vsix
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
if: runner.os == 'Linux'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.set-version.outputs.name }}.vsix
asset_name: ${{ steps.set-version.outputs.name }}.vsix
asset_content_type: application/zip
- name: Publish to VSCode Marketplace
run: |
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \
npx vsce publish --packagePath ${{ steps.set-version.outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true
- name: Publish to Open VSX Registry
run: |
[ -n "${{ secrets.OVSX_TOKEN }}" ] && \
npx ovsx publish --packagePath ${{ steps.set-version.outputs.name }}.vsix --pat ${{ secrets.OVSX_TOKEN }} || true
3 changes: 2 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.github/**
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md