-
Notifications
You must be signed in to change notification settings - Fork 8
73 lines (73 loc) · 2.35 KB
/
main.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# SPDX-License-Identifier: Apache-2.0
#
---
name: CI
on:
push:
branches-ignore:
- gh-pages
pull_request:
branches-ignore:
- gh-pages
schedule:
- cron: "0 0 * * *"
create:
tags:
- "*"
workflow_dispatch: {}
env:
DISPLAY: :99.0
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Start Xvfb
run: nohup Xvfb :99 -screen 0 1024x768x24 < /dev/null > /dev/null 2>&1 &
- name: Use Node.js 12
uses: actions/setup-node@v2
with:
node-version: 12
- name: Install Visual Studio Code Extensions CLI
run: npm install -g vsce
- name: Install extension dependencies
run: npm ci
- name: Audit extension dependencies
run: npm audit
- name: Run extension tests
run: npm test
- name: Package extension
run: vsce package
- name: Publish extension to Visual Studio Code Marketplace
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
run: |
vsce publish -p ${VSCE_TOKEN}
if: startsWith(github.ref, 'refs/tags/')
- name: Set GitHub user name and email
env:
AUTO_GITHUB_NAME: ${{ secrets.AUTO_GITHUB_NAME }}
AUTO_GITHUB_EMAIL: ${{ secrets.AUTO_GITHUB_EMAIL }}
run: |
git config --global user.name ${AUTO_GITHUB_NAME}
git config --global user.email ${AUTO_GITHUB_EMAIL}
git config --local --unset-all http.${GITHUB_SERVER_URL}/.extraheader
if: startsWith(github.ref, 'refs/tags/')
- name: Use npm to bump version
run: npm version patch --no-git-tag-version
if: startsWith(github.ref, 'refs/tags/')
- name: Commit version bump
run: |
VERSION=$(jq -r ".version" package.json)
git commit -asm "Automatic version bump to ${VERSION}"
if: startsWith(github.ref, 'refs/tags/')
- name: Push commit to GitHub
env:
AUTO_GITHUB_NAME: ${{ secrets.AUTO_GITHUB_NAME }}
AUTO_GITHUB_ACCESS_TOKEN: ${{ secrets.AUTO_GITHUB_ACCESS_TOKEN }}
run: |
git -c http.extraheader="Authorization: Basic $(echo -n ${AUTO_GITHUB_NAME}:${AUTO_GITHUB_ACCESS_TOKEN} | base64)" push ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} HEAD:main -f
if: startsWith(github.ref, 'refs/tags/')