feat:SP-1846 Adds sbom-format flag to inspect undeclared command #35
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: Publish Python Package - PyPI | |
# This workflow will upload a Python Package using Twine to PyPI and create a draft release when a tag is pushed | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
- name: Build Package - ${{ github.ref_name }} | |
run: make dist | |
- name: Install Test Package | |
run: | | |
pip install -r requirements.txt | |
pip install dist/scanoss-*-py3-none-any.whl | |
which scanoss-py | |
- name: Run Local Tests | |
run: | | |
which scanoss-py | |
scanoss-py version | |
scanoss-py utils fast | |
scanoss-py scan tests > results.json | |
id_count=$(cat results.json | grep '"id":' | wc -l) | |
echo "ID Count: $id_count" | |
if [[ $id_count -lt 1 ]]; then | |
echo "Error: Scan test did not produce any results. Failing" | |
exit 1 | |
fi | |
pip uninstall -y scanoss | |
- name: Publish Package - ${{ github.ref_name }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
# skip-existing: true | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- name: Create Draft Release ${{ github.ref_type }} - ${{ github.ref_name }} | |
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: dist/* | |
test: | |
if: success() | |
needs: [ deploy ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10.x' | |
- name: Install Remote Package | |
run: | | |
scanoss_version=$(python ./version.py) | |
echo "Sleeping before checking PyPI for new release version ${scanoss_version}..." | |
sleep 60 | |
echo "Installing scanoss ${scanoss_version}..." | |
pip install --upgrade scanoss==$scanoss_version | |
which scanoss-py | |
- name: Run Tests | |
run: | | |
which scanoss-py | |
scanoss-py version | |
scanoss-py utils fast | |
scanoss-py scan tests > results.json | |
id_count=$(cat results.json | grep '"id":' | wc -l) | |
echo "ID Count: $id_count" | |
if [[ $id_count -lt 1 ]]; then | |
echo "Error: Scan test did not produce any results. Failing" | |
exit 1 | |
fi | |
- name: Run Tests (fast winnowing) | |
run: | | |
pip install scanoss_winnowing | |
which scanoss-py | |
scanoss-py version | |
scanoss-py utils fast | |
scanoss-py scan tests > results.json | |
id_count=$(cat results.json | grep '"id":' | wc -l) | |
echo "ID Count: $id_count" | |
if [[ $id_count -lt 1 ]]; then | |
echo "Error: Scan test did not produce any results. Failing" | |
exit 1 | |
fi |