Skip to content

Add zizmor as github actions run #84

Add zizmor as github actions run

Add zizmor as github actions run #84

name: Create ScanCode release archives, then test and publish to GH and PyPI

Check failure on line 1 in .github/workflows/scancode-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/scancode-release.yml

Invalid workflow file

(Line: 579, Col: 9): Job 'publish_to_pypi' depends on unknown job 'smoke_test_install_and_run_pypi_wheels_on_macos'.
# This is executed automatically on a tag
#
# Summary of the steps:
# - Build wheel and sdist for the "main" scancode, then build these for the "mini" flavor
# - test each wheel and sdist on every possible OS x Python version combinations
# - Build release app archives, one for each of linux, windows, macos on Python 3.10 to 3.13
# - test each on its target OS and Python version
# - Create gh-release and upload app archives to release
# - Upload all wheels and sdist to PyPI
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
permissions: {}
jobs:
build_scancode_wheels_sdist_for_pypi:
permissions:
contents: read # to fetch code (actions/checkout)
name: Build PyPI wheels
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: 3.14
- name: Install requirements then build main and mini wheel, sdist
run: etc/release/scancode-create-pypi-wheel-and-sdist.sh
- name: Install requirements then build licensedcode data/index wheels, sdist
run: etc/release/licensedcode-create-pypi-wheel-and-sdist.sh
- name: Collect built wheels and sdist
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: wheels_sdist
path: dist/*
build_scancode_for_release_linux:
permissions:
contents: read # to fetch code (actions/checkout)
name: Build app Release for linux
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
pyver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- run: git fetch --prune --unshallow
- name: Set up Python on ${{ matrix.pyver }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.pyver }}
- name: Build linux app archive
run: etc/release/scancode-create-release-app-linux.sh ${{ matrix.pyver }}
- name: Collect built linux app for python ${{ matrix.pyver }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: linux_app_py_${{ matrix.pyver }}
path: release/*
build_scancode_for_release_macos:
permissions:
contents: read # to fetch code (actions/checkout)
name: Build app Release for mac
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
pyver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- run: git fetch --prune --unshallow
- name: Set up Python on ${{ matrix.pyver }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.pyver }}
- name: Build mac app archive
run: etc/release/scancode-create-release-app-macos.sh ${{ matrix.pyver }}
- name: Collect built mac app for python ${{ matrix.pyver }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: macos_app_py_${{ matrix.pyver }}
path: release/*
build_scancode_for_release_windows:
permissions:
contents: read # to fetch code (actions/checkout)
name: Build app Release for windows
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
pyver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- run: git fetch --prune --unshallow
- name: Set up Python on ${{ matrix.pyver }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.pyver }}
- name: Build windows app archive
run: etc/release/scancode-create-release-app-windows.sh ${{ matrix.pyver }}
- name: Collect built windows app for python ${{ matrix.pyver }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: windows_app_py_${{ matrix.pyver }}
path: release/*
build_scancode_for_release_source:
permissions:
contents: read # to fetch code (actions/checkout)
name: Build app source
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
strategy:
fail-fast: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- run: git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: "3.14"
- name: Build source archive with deps
run: etc/release/scancode-create-release-app-sources.sh
- name: Collect built source app tarball
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: source_app
path: release/*
smoke_test_install_and_run_pypi_wheels_on_linux:
permissions:
contents: read # to fetch code (actions/checkout)
name: Test PyPI wheels on linux
needs:
- build_scancode_wheels_sdist_for_pypi
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
os: [ubuntu-24.04, ubuntu-24.04]
pyver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set up Python ${{ matrix.pyver }} on ${{ matrix.os }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.pyver }}
- name: Download wheels artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: wheels_sdist
path: dist
- name: install and test wheels
run: |
echo "license: gpl-2.0" > some.file
rm -rf venv; \
python -m venv venv
venv/bin/python -m pip install --upgrade pip wheel setuptools
for f in `find dist -type f -name "licensedcode*.whl"`; \
do \
venv/bin/python -m pip install --force-reinstall "$f" ; \
done
for f in `find dist -type f -name "scancode_toolkit-*.whl"`; \
do \
venv/bin/python -m pip install --force-reinstall "$f[full]" ; \
venv/bin/scancode -clipeu --json-pp - some.file ; \
done
smoke_test_install_and_run_pypi_wheels_on_windows:
permissions:
contents: read # to fetch code (actions/checkout)
name: Test PyPI wheels on Windows
needs:
- build_scancode_wheels_sdist_for_pypi
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
os: [windows-2025, windows-2022]
pyver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set up Python ${{ matrix.pyver }} on ${{ matrix.os }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.pyver }}
- name: Download wheels artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: wheels_sdist
path: dist
- name: install and test wheels
run: |
echo "license: gpl-2.0" > some.file
python -m venv venv
venv/Scripts/python.exe -m pip install --upgrade pip
for f in `find dist -type f -name "licensedcode*.whl"`; \
do \
venv/Scripts/python.exe -m pip install --force-reinstall "$f" ; \
done
for f in `find dist -type f -name "scancode_toolkit-*.whl"`; \
do \
venv/Scripts/python.exe -m pip install --force-reinstall "$f[full]" ; \
venv/Scripts/scancode -clipeu --json-pp - some.file ; \
done
smoke_test_install_and_run_app_archives_on_linux:
permissions:
contents: read # to fetch code (actions/checkout)
name: Test app on ${{ matrix.os }}
needs:
- build_scancode_for_release_linux
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
os: [ubuntu-24.04, ubuntu-24.04]
pyver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set up Python ${{ matrix.pyver }} on ${{ matrix.os }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.pyver }}
- name: Download a single artifact linux_app_py_${{ matrix.pyver }}
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: linux_app_py_${{ matrix.pyver }}
path: dist
- name: test install app archive
run: |
for f in `find dist -type f -name "*.zip"`; \
do \
unzip file.zip $f; \
done
for f in `find dist -type f -name "*.tar.gz"`; \
do \
python etc/release/scancode_release_tests.py $f; \
done
smoke_test_install_and_run_app_archives_on_macos:
permissions:
contents: read # to fetch code (actions/checkout)
name: Test app on ${{ matrix.os }}
needs:
- build_scancode_for_release_macos
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
os: [macos-14, macos-15]
pyver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set up Python ${{ matrix.pyver }} on ${{ matrix.os }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.pyver }}
- name: Download a single artifact macos_app_py_${{ matrix.pyver }}
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: macos_app_py_${{ matrix.pyver }}
path: dist
- name: test install app archive
run: |
for f in `find dist -type f -name "*.zip"`; \
do \
unzip file.zip $f; \
done
for f in `find dist -type f -name "*.tar.gz"`; \
do \
python etc/release/scancode_release_tests.py $f; \
done
smoke_test_install_and_run_app_archives_on_windows:
permissions:
contents: read # to fetch code (actions/checkout)
name: Test app on ${{ matrix.os }}
needs:
- build_scancode_for_release_windows
runs-on: ${{ matrix.os }}
defaults:
run:
shell: cmd
strategy:
fail-fast: true
matrix:
os: [windows-2025, windows-2022]
pyver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set up Python ${{ matrix.pyver }} on ${{ matrix.os }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: ${{ matrix.pyver }}
- name: Download a single artifact windows_app_py_${{ matrix.pyver }}
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: windows_app_py_${{ matrix.pyver }}
path: dist
- name: test install app archive
run: |
for %%F in (dist/*.zip) do python etc/release/scancode_release_tests.py dist/%%F
publish_to_gh_release:
permissions:
contents: write # to create GitHub release (softprops/action-gh-release)
name: Publish to GH Release
needs:
- smoke_test_install_and_run_app_archives_on_linux
- smoke_test_install_and_run_app_archives_on_windows
- smoke_test_install_and_run_app_archives_on_macos
- build_scancode_for_release_source
- build_scancode_for_release_windows
- build_scancode_for_release_linux
- build_scancode_for_release_macos
- build_scancode_wheels_sdist_for_pypi
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
strategy:
fail-fast: true
steps:
- name: Download a single artifact source_app
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: source_app
path: dist
- name: Download a single artifact macos_app for python 3.10
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: macos_app_py_3.10
path: dist
- name: Download a single artifact macos_app for python 3.11
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: macos_app_py_3.11
path: dist
- name: Download a single artifact macos_app for python 3.12
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: macos_app_py_3.12
path: dist
- name: Download a single artifact macos_app for python 3.13
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: macos_app_py_3.13
path: dist
- name: Download a single artifact macos_app for python 3.14
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: macos_app_py_3.14
path: dist
- name: Download a single artifact linux_app for python 3.10
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: linux_app_py_3.10
path: dist
- name: Download a single artifact linux_app for python 3.11
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: linux_app_py_3.11
path: dist
- name: Download a single artifact linux_app for python 3.12
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: linux_app_py_3.12
path: dist
- name: Download a single artifact linux_app for python 3.13
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: linux_app_py_3.13
path: dist
- name: Download a single artifact linux_app for python 3.14
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: linux_app_py_3.14
path: dist
- name: Download a single artifact windows_app for python 3.10
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: windows_app_py_3.10
path: dist
- name: Download a single artifact windows_app for python 3.11
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: windows_app_py_3.11
path: dist
- name: Download a single artifact windows_app for python 3.12
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: windows_app_py_3.12
path: dist
- name: Download a single artifact windows_app for python 3.13
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: windows_app_py_3.13
path: dist
- name: Download a single artifact windows_app for python 3.14
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: windows_app_py_3.14
path: dist
- name: Download scancode and licensedcode wheels
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: wheels_sdist
path: dist
- name: Mock GH release
run: |
ls -al dist
- name: Create release and publish archives
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
with:
draft: true
files: dist/*
publish_to_pypi:
name: Publish to PyPI
needs:
- build_scancode_wheels_sdist_for_pypi
- smoke_test_install_and_run_pypi_wheels_on_windows
- smoke_test_install_and_run_pypi_wheels_on_macos
- smoke_test_install_and_run_pypi_wheels_on_linux
- publish_to_gh_release
runs-on: ubuntu-24.04
environment: pypi-publish
permissions:
id-token: write
defaults:
run:
shell: bash
steps:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: 3.14
- name: scancode and licensedcode wheels
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: wheels_sdist
path: dist
- name: Mock PyPI upload
run: |
ls -al dist
- name: Publish distributions to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b