summaryrefslogtreecommitdiffstats
path: root/.github/workflows/cd.yml
blob: 95785ab90670b67f28fc03b6cea5dc29ba386a48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: CD

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
  release:
    types:
      - created

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Use Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '15.11.0'
      - run: yarn

      - name: Install VSCE
        run: yarn add vsce -D

      - name: Update $PATH
        run: echo "$PWD/node_modules/.bin/" >> $GITHUB_PATH

      - name: Build vsix
        run: vsce package && ls -alh

      - name: Deploy to Marketplace
        run: vsce publish -p ${VSCE_TOKEN}
        env:
          VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
        if: contains(github.ref, 'refs/tags/')

      - name: Upload vsix to GitHub release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: doxdocgen-*.vsix
          tag: ${{ github.ref }}
          overwrite: true
          file_glob: true
        if: contains(github.ref, 'refs/tags/')