This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
115 lines (95 loc) · 2.69 KB
/
ci.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: CI
on:
push:
branches:
- master
- release/**
tags:
- v*.*.*
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup nodejs
uses: actions/setup-node@v2
with:
node-version: "12"
- name: Setup display
run: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
if: contains(matrix.os, 'ubuntu')
- name: Install
run: npm ci
env:
CI: true
- name: Check formatting
run: npm run format
env:
CI: true
- name: Build and test
run: |
npm run compile
npm run test
env:
CI: true
DISPLAY: ":99.0"
- name: Package
run: |
npm run package
env:
CI: true
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup nodejs
uses: actions/setup-node@v2
with:
node-version: "12"
- name: Get project version
id: project-version
shell: pwsh
run: |
$project_version = (node -p "require('./package.json').version")
echo "::set-output name=version::$project_version"
- name: Get changelog entry
id: changelog_reader
uses: mindsers/[email protected]
with:
version: ${{ github.ref }}
path: ./CHANGELOG.md
- name: Package
run: |
npm ci
npm run package
- name: Publish to VSCode marketplace
run: npm run deploy -p ${{ secrets.VSCE_TOKEN }}
- name: Create Github release
id: create_github_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changelog_reader.outputs.log_entry }}
draft: false
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_github_release.outputs.upload_url }}
asset_path: ./clang-tidy-${{ steps.project-version.outputs.version }}.vsix
asset_name: clang-tidy-${{ steps.project-version.outputs.version }}.vsix
asset_content_type: application/octet-stream