-
Notifications
You must be signed in to change notification settings - Fork 6
96 lines (94 loc) · 3.28 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build & Publish
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [published]
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
name: 'Build & Analyse (${{ matrix.os }} - Java ${{ matrix.java-version }} - Node ${{ matrix.node-version }})'
strategy:
matrix:
node-version: ['16']
java-version: ['11']
os: [ubuntu-latest, windows-latest]
# os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: Use Java ${{ matrix.java-version }}
uses: actions/[email protected]
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
architecture: x64
- name: Install NPM Packages
run: npm ci
- name: Lint extension
run: npm run lint
- name: Prepare Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build -x spotlessCheck
build-root-directory: test-fixtures/gradle-project
gradle-executable: test-fixtures/gradle-project/gradlew
- name: Prepare Spotless
uses: gradle/gradle-build-action@v2
with:
arguments: spotlessDiagnose --no-configuration-cache
build-root-directory: test-fixtures/gradle-project
gradle-executable: test-fixtures/gradle-project/gradlew
- name: Prepare Gradle (multi-project)
uses: gradle/gradle-build-action@v2
with:
arguments: build -x spotlessCheck
build-root-directory: test-fixtures/gradle-multi-project
gradle-executable: test-fixtures/gradle-multi-project/gradlew
- name: Prepare Spotless (multi-project)
uses: gradle/gradle-build-action@v2
with:
arguments: spotlessDiagnose --no-configuration-cache
build-root-directory: test-fixtures/gradle-multi-project
gradle-executable: test-fixtures/gradle-multi-project/gradlew
- name: Install test-fixtures NPM packages
run: |
npm ci --prefix test-fixtures/gradle-project
- name: Start Xvfb
run: |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
if: matrix.os == 'ubuntu-latest'
- name: Build & Test Extension
run: |
npm run compile:all
npm run test
env:
DISPLAY: ':99.0'
publish:
name: Publish extension
runs-on: ubuntu-latest
needs: [build-and-test]
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v1
- uses: actions/[email protected]
with:
node-version: 16
- name: Install packages
run: |
npm install
- name: Build & publish extension
env:
AZURE_TOKEN: ${{ secrets.AZURE_TOKEN }}
VSX_REGISTRY_ACCESS_TOKEN: ${{ secrets.VSX_REGISTRY_ACCESS_TOKEN }}
run: |
tag=${GITHUB_REF#refs/tags/}
echo "Setting package version $tag"
npm --no-git-tag-version version "$tag"
npm run publish -- -p "$AZURE_TOKEN"
# npx ovsx publish -p "$VSX_REGISTRY_ACCESS_TOKEN"