This repository was archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 236
116 lines (112 loc) · 3.27 KB
/
build.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
116
name: CI-Tests
on:
push:
branches:
- master
- dev
tags:
- v*
pull_request:
branches:
- master
- dev
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- name: checkout
uses: actions/checkout@v2
- name: get node
uses: actions/setup-node@v1
with:
node-version: 11.x
- name: linux setup
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0
sleep 3
wget https://downloads.arduino.cc/arduino-1.8.2-linux64.tar.xz -P /home/$USER
tar -xvf /home/$USER/arduino-1.8.2-linux64.tar.xz -C /home/$USER/
sudo ln -s /home/$USER/arduino-1.8.2/arduino /usr/bin/arduino
sudo apt-get update
sudo apt-get install g++-multilib
sudo apt-get install -y build-essential
sudo apt-get install libudev-dev
- name: macos setup
if: ${{ matrix.os == 'macos-latest' }}
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install arduino --cask
- name: preinstall
run: |
npm install -g node-gyp
npm install -g vsce@"^1.0.0"
npm install -g gulp
- name: install
run: npm install
- name: scripts
run: |
gulp tslint
vsce package
- name: run tests
if: ${{ matrix.os != 'windows-latest' }}
uses: GabrielBB/xvfb-action@v1
with:
run: npm test --silent
deploy:
needs: build
runs-on: ubuntu-latest
environment: vsix-publishing
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- run: echo ${{env.VERSION}}
- name: Checkout
uses: actions/checkout@v2
- name: get node
uses: actions/setup-node@v1
with:
node-version: 11.x
- name: linux setup
run: |
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0
sleep 3
sudo apt-get update
sudo apt-get install g++-multilib
sudo apt-get install -y build-essential
sudo apt-get install libudev-dev
- name: preinstall
run: |
npm install -g node-gyp
npm install -g vsce@"^1.0.0"
npm install -g gulp
- name: install
run: npm install
- name: scripts
run: |
gulp tslint
vsce package
- name: upload .vsix to github tag
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.OAUTH_TOKEN }}
file: ${{github.workspace}}/vscode-arduino*.vsix
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: check for production tag
id: check-version
run: |
if [[ ${{ env.VERSION }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=ISPRODUCTION::true
fi
- name: publish
if: steps.check-version.outputs.ISPRODUCTION == 'true'
env:
PROD_AIKEY: ${{ secrets.PROD_AIKEY }}
run: |
gulp genAikey
vsce publish -p ${{ secrets.VSCE_TOKEN }}