8000 trying something different · vscode-arduino/vscode-arduino@315f611 · GitHub
[go: up one dir, main page]

Skip to content

Commit 315f611

Browse files
committed
trying something different
1 parent d7c92e4 commit 315f611

File tree

3 files changed

+118
-108
lines changed

3 files changed

+118
-108
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# Copyright (c) Microsoft Corporation.
2-
# Licensed under the MIT License.
3-
41
name: Build CI
5-
62
on:
73
push:
84
branches:
@@ -12,104 +8,8 @@ on:
128
pull_request:
139
branches:
1410
- main
15-
workflow_call:
16-
inputs:
17-
BUILD_FLAGS:
18-
description: 'additional build flags to pass to build'
19-
default: ''
20-
required: false
21-
type: string
22-
os:
23-
description: os to use in the run
24-
type: string
25-
default: '["ubuntu-latest", "macos-latest", "windows-latest"]'
26-
required: false
2711

2812
jobs:
2913
build:
30-
env:
31-
BUILD_FLAGS: ${{ inputs.BUILD_FLAGS }}
32-
runs-on: ${{ matrix.os }}
33-
strategy:
34-
fail-fast: false
35-
matrix:
36-
os: ${{ fromJson(inputs.os) }} # [ ubuntu-latest, macos-latest, windows-latest ]
37-
38-
39-
steps:
40-
- name: Checkout
41-
uses: actions/checkout@v2
42-
43-
# Node 16 matches the version of Node used by VS Code when this was
44-
# written, but it should be updated when VS Code updates its Node version.
45-
# Node needs to be installed before OS-specific setup so that we can run
46-
# the hash verification script.
47-
- name: Use Node 18.x
48-
uses: actions/setup-node@v2
49-
with:
50-
node-version: 18.x
51-
52-
# On new macos-latest machines, Python 3.9+ is used, and it's causing issues with binding.gyp
53-
- name: Use Python 3.8
54-
if: ${{ matrix.os == 'macos-latest' }}
55-
uses: actions/setup-python@v5
56-
with:
57-
python-version: 3.8
58-
59-
- name: Windows setup
60-
if: ${{ matrix.os == 'windows-latest' }}
61-
run: |
62-
curl -LO https://downloads.arduino.cc/arduino-1.8.19-windows.zip
63-
node build/checkHash.js arduino-1.8.19-windows.zip `
64-
c704a821089eab2588f1deae775916219b1517febd1dd574ff29958dca873945
65-
7z x arduino-1.8.19-windows.zip -o"$Env:TEMP\arduino-ide"
66-
echo "$Env:TEMP\arduino-ide\arduino-1.8.19" | Out-File -FilePath $env:GITHUB_PATH -Append
67-
- name: Linux setup
68-
if: ${{ matrix.os == 'ubuntu-latest' }}
69-
run: |
70-
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0
71-
sleep 3
72-
wget https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz -P /home/$USER
73-
node build/checkHash.js /home/$USER/arduino-1.8.19-linux64.tar.xz \
74-
eb68bddc1d1c0120be2fca1350a03ee34531cf37f51847b21210b6e70545bc9b
75-
tar -xvf /home/$USER/arduino-1.8.19-linux64.tar.xz -C /home/$USER/
76-
sudo ln -s /home/$USER/arduino-1.8.19/arduino /usr/bin/arduino
77-
sudo apt-get update
78-
sudo apt-get install -y g++-multilib build-essential libudev-dev
79-
- name: macOS setup
80-
if: ${{ matrix.os == 'macos-latest' }}
81-
run: |
82-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
83-
brew install arduino --cask
84-
85-
# Windows agents already have gulp installed.
86-
- name: Install gulp
87-
if: ${{ matrix.os != 'windows-latest' }}
88-
run: npm install --global gulp
89-
- name: Install global dependencies
90-
run: npm install --global node-gyp vsce
91-
- name: Install project dependencies
92-
run: npm install
93-
94-
- name: Check for linting errors
95-
run: gulp tslint
96-
- name: Build and pack extension
97-
if: ${{ matrix.os != 'windows-latest' }}
98-
run: |
99-
export NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch"
100-
node build/package.js ${{ env.BUILD_FLAGS }}
101-
- name: Build and pack extension (windows)
102-
if: ${{ matrix.os == 'windows-latest' }}
103-
run: |
104-
$env:NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch"
105-
node build/package.js ${{ env.BUILD_FLAGS }}
106-
- name: Publish extension VSIX as artifact
107-
uses: actions/upload-artifact@v2
108-
with:
109-
name: VS Code extension VSIXes (${{ matrix.os }})
110-
path: out/vsix
111-
112-
- name: Run tests
113-
uses: GabrielBB/xvfb-action@v1
114-
with:
115-
run: npm test --silent
14+
uses: ./.github/workflows/templates/build.yml
15+

.github/workflows/deploy-pre-release.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
call-build:
14-
uses: ./.github/workflows/build.yml
14+
uses: ./.github/workflows/template/build.yml
1515
with:
1616
BUILD_FLAGS: '--pre-release'
1717
os: '["ubuntu-latest"]'
@@ -32,12 +32,15 @@ jobs:
3232

3333
- name: install vsce
3434
run: npm install --global vsce
35+
36+
- name: vsce login
37+
run: echo ${{ secrets.VSCE_PASSWORD }} | vsce login ${{ secrets.VSCE_USER }}
38+
39+
- name: publish extension
40+
run: vsce publish --pre-release --packagePath ./out/vsix/*
3541

36-
- name: upload extension
37-
run: |
38-
echo ${{ secrets.VSCE_PASSWORD }} | vsce login ${{ secrets.VSCE_USER }}
39-
vsce publish --pre-release --packagePath ./out/vsix/*
40-
vsce logout
42+
- name: vsce logout
43+
run: vsce logout
4144

4245

4346

.github/workflows/templates/build.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
name: Build CI Template
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
BUILD_FLAGS:
10+
description: 'additional build flags to pass to build'
11+
default: ''
12+
required: false
13+
type: string
14+
os:
15+
description: os to use in the run
16+
type: string
17+
default: '["ubuntu-latest", "macos-latest", "windows-latest"]'
18+
required: false
19+
20+
jobs:
21+
build:
22+
env:
23+
BUILD_FLAGS: ${{ inputs.BUILD_FLAGS }}
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
os: ${{ fromJson(inputs.os) }}
29+
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
35+
# Node 16 matches the version of Node used by VS Code when this was
36+
# written, but it should be updated when VS Code updates its Node version.
37+
# Node needs to be installed before OS-specific setup so that we can run
38+
# the hash verification script.
39+
- name: Use Node 18.x
40+
uses: actions/setup-node@v2
41+
with:
42+
node-version: 18.x
43+
44+
# On new macos-latest machines, Python 3.9+ is used, and it's causing issues with binding.gyp
45+
- name: Use Python 3.8
46+
if: ${{ matrix.os == 'macos-latest' }}
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: 3.8
50+
51+
- name: Windows setup
52+
if: ${{ matrix.os == 'windows-latest' }}
53+
run: |
54+
curl -LO https://downloads.arduino.cc/arduino-1.8.19-windows.zip
55+
node build/checkHash.js arduino-1.8.19-windows.zip `
56+
c704a821089eab2588f1deae775916219b1517febd1dd574ff29958dca873945
57+
7z x arduino-1.8.19-windows.zip -o"$Env:TEMP\arduino-ide"
58+
echo "$Env:TEMP\arduino-ide\arduino-1.8.19" | Out-File -FilePath $env:GITHUB_PATH -Append
59+
- name: Linux setup
60+
if: ${{ matrix.os == 'ubuntu-latest' }}
61+
run: |
62+
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0
63+
sleep 3
64+
wget https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz -P /home/$USER
65+
node build/checkHash.js /home/$USER/arduino-1.8.19-linux64.tar.xz \
66+
eb68bddc1d1c0120be2fca1350a03ee34531cf37f51847b21210b6e70545bc9b
67+
tar -xvf /home/$USER/arduino-1.8.19-linux64.tar.xz -C /home/$USER/
68+
sudo ln -s /home/$USER/arduino-1.8.19/arduino /usr/bin/arduino
69+
sudo apt-get update
70+
sudo apt-get install -y g++-multilib build-essential libudev-dev
71+
- name: macOS setup
72+
if: ${{ matrix.os == 'macos-latest' }}
73+
run: |
74+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
75+
brew install arduino --cask
76+
77+
# Windows agents already have gulp installed.
78+
- name: Install gulp
79+
if: ${{ matrix.os != 'windows-latest' }}
80+
run: npm install --global gulp
81+
- name: Install global dependencies
82+
run: npm install --global node-gyp vsce
83+
- name: Install project dependencies
84+
run: npm install
85+
86+
- name: Check for linting errors
87+
run: gulp tslint
88+
- name: Build and pack extension
89+
if: ${{ matrix.os != 'windows-latest' }}
90+
run: |
91+
export NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch"
92+
node build/package.js ${{ env.BUILD_FLAGS }}
93+
- name: Build and pack extension (windows)
94+
if: ${{ matrix.os == 'windows-latest' }}
95+
run: |
96+
$env:NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch"
97+
node build/package.js ${{ env.BUILD_FLAGS }}
98+
- name: Publish extension VSIX as artifact
99+
uses: actions/upload-artifact@v2
100+
with:
101+
name: VS Code extension VSIXes (${{ matrix.os }})
102+
path: out/vsix
103+
104+
- name: Run tests
105+
uses: GabrielBB/xvfb-action@v1
106+
with:
107+
run: npm test --silent

0 commit comments

Comments
 (0)
0