Skip to content

[Snyk] Fix for 1 vulnerabilities #704

[Snyk] Fix for 1 vulnerabilities

[Snyk] Fix for 1 vulnerabilities #704

Workflow file for this run

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/setup-node@v2.5.1
with:
node-version: ${{ matrix.node-version }}
- name: Use Java ${{ matrix.java-version }}
uses: actions/setup-java@v2.5.0
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/setup-node@v2.5.1
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"