-
Notifications
You must be signed in to change notification settings - Fork 60
93 lines (89 loc) · 2.55 KB
/
main.yml
File metadata and controls
93 lines (89 loc) · 2.55 KB
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
name: CI
on: [pull_request, push]
jobs:
build-vsix:
name: Build - VSIX
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: "temurin"
- run: ./gradlew build updateVersions -PbuildServer
name: Build with Gradle
- name: Install dependencies
run: npm install
working-directory: vscode-wpilib
- name: Run tests
run: xvfb-run -a npm test
working-directory: vscode-wpilib
- run: |
npm run lint
npm run gulp
npm run webpack
npm run vscePackage
working-directory: vscode-wpilib
name: Build VSIX
- uses: actions/upload-artifact@v4
with:
name: VSIX
path: ${{ github.workspace }}/**/*.vsix
- uses: actions/upload-artifact@v4
with:
name: Distributions
path: ${{ github.workspace }}/build/distributions/*
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Run Prettier
run: npx prettier -w .
working-directory: vscode-wpilib
- name: Check output
run: git --no-pager diff --exit-code HEAD
- name: Generate diff
run: git diff HEAD > format-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v4
with:
name: format fixes
path: format-fixes.patch
if: ${{ failure() }}
- name: Write to job summary
run: |
echo '```diff' >> $GITHUB_STEP_SUMMARY
cat format-fixes.patch >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
if: ${{ failure() }}
release:
name: "Release"
runs-on: ubuntu-latest
needs: [build-vsix]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
name: Download Artifacts
with:
path: artifacts
- uses: softprops/action-gh-release@v2
name: Release
with:
body_path: ${{ github.workspace }}/.github/ReleaseBody.txt
prerelease: true
files: "artifacts/**/*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}