Fix extension description #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pull Request | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- closed | |
push: | |
tags: | |
- "*" | |
jobs: | |
style: | |
name: style | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/tektronix/tsp-toolkit-build:latest | |
credentials: | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
steps: | |
- name: Tool Versions | |
run: npx prettier --version | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: run prettier | |
run: npx prettier --list-different | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/tektronix/tsp-toolkit-build:latest | |
credentials: | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
steps: | |
- name: Tool Versions | |
run: npx eslint --version | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc | |
npm install | |
- name: Run eslint | |
run: 'npx eslint --rule "{ prettier/prettier: off }" src' | |
sbom: | |
name: Generate CycloneDX | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/tektronix/tsp-toolkit-build:latest | |
credentials: | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Tools | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc | |
npm ci --devDependencies | |
- name: Generate NPM BOM | |
run: npx @cyclonedx/cyclonedx-npm --output-format JSON --package-lock-only --output-reproducible --output-file npm.cdx.json | |
- name: Upload Results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: software-bom | |
path: | | |
**/*.cdx.json | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/tektronix/tsp-toolkit-build:latest | |
credentials: | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
steps: | |
- name: Tool Versions | |
run: npx prettier --version | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc | |
npm install | |
- name: Run Tests with Coverage | |
run: npx nyc --nycrc-path=.nycrc.json npm run test-ci | |
- name: Generate Coverage Reports | |
run: npx nyc report --reporter=cobertura --reporter=text | |
compile: | |
name: compile | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/tektronix/tsp-toolkit-build:latest | |
credentials: | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
steps: | |
- name: Update ClamAV | |
run: freshclam | |
- name: Tool Versions | |
run: | | |
npm --version | |
clamscan -V | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc | |
npm install | |
- name: Build | |
run: npm run compile | |
- name: npm Package | |
run: | | |
npx vsce package --pre-release | |
- name: Run ClamAV | |
run: clamscan -v *.vsix | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: package | |
path: "*.vsix" | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
checks: write | |
pull-requests: read | |
needs: | |
- compile | |
- test | |
- sbom | |
- lint | |
- style | |
if: ${{ endsWith(github.base_ref, 'main') && contains(github.head_ref, 'release') }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Get RC Version | |
id: lasttag | |
run: | | |
COMMIT="${{github.sha}}" | |
V="${{github.head_ref}}" | |
V="${V#release/}" | |
if ${{! github.event.pull_request.merged}}; then | |
V="${V}-$(git tag --list ${V}* | wc -l)" | |
fi | |
CL=${V#v} | |
CL=${CL%-*} | |
echo "version=${V}" >> $GITHUB_OUTPUT | |
echo "cl_version=${CL}" >> $GITHUB_OUTPUT | |
echo "commit=${COMMIT}" >> $GITHUB_OUTPUT | |
- run: 'git tag --list ${V}*' | |
- name: Get Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: package | |
path: extension | |
- name: Get SBOM | |
uses: actions/download-artifact@v3 | |
with: | |
name: software-bom | |
path: sbom | |
- name: Get Changelog for this Tag | |
id: changelog | |
uses: coditory/changelog-parser@v1 | |
with: | |
version: ${{steps.lasttag.outputs.cl_version}} | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: ${{steps.lasttag.outputs.version}} | |
artifacts: "extension/*.vsix,sbom/**/*" | |
body: | | |
## Features Requests / Bugs | |
If you find issues or have a feature request, please enter a [new issue on GitHub](${{github.server_url}}/${{github.repository}}/issues/new). | |
## Installation | |
View the installation instructions in the [README](${{github.server_url}}/${{github.repository}}/blob/main/README.md) | |
## Changelog | |
${{steps.changelog.outputs.description}} | |
prerelease: ${{! github.event.pull_request.merged}} | |
commit: ${{steps.lasttag.outputs.commit}} | |
makeLatest: true | |
tag: ${{steps.lasttag.outputs.version}} | |