Skip to content

Commit 9dfc115

Browse files
Update github action release scripts for multiple wheels
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
1 parent a500061 commit 9dfc115

File tree

3 files changed

+140
-60
lines changed

3 files changed

+140
-60
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Create library release archives, create a GH release and publish PyPI wheel and sdist on tag in main branch
2+
3+
4+
# This is executed automatically on a tag in the main branch
5+
6+
# Summary of the steps:
7+
# - build wheels and sdist
8+
# - upload wheels and sdist to PyPI
9+
# - create gh-release and upload wheels and dists there
10+
# TODO: smoke test wheels and sdist
11+
# TODO: add changelog to release text body
12+
13+
# WARNING: this is designed only for packages building as pure Python wheels
14+
15+
on:
16+
workflow_dispatch:
17+
push:
18+
tags:
19+
- "licensedcode-v*.*.*"
20+
21+
jobs:
22+
build-pypi-distribs:
23+
permissions:
24+
contents: read # to fetch code (actions/checkout)
25+
26+
name: Build and publish library to PyPI
27+
runs-on: ubuntu-24.04
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: 3.14
35+
36+
- name: Install pypa/build and twine
37+
run: python -m pip install --user --upgrade build twine pkginfo flot
38+
39+
- name: Install requirements then build main and mini wheel
40+
run: etc/release/licensedcode-create-pypi-wheel-and-sdist.sh
41+
42+
- name: Upload built archives
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: pypi_archives
46+
path: dist/*
47+
48+
49+
create-gh-release:
50+
permissions:
51+
contents: write
52+
53+
name: Create GH release
54+
needs:
55+
- build-pypi-distribs
56+
runs-on: ubuntu-24.04
57+
58+
steps:
59+
- name: Download built archives
60+
uses: actions/download-artifact@v4
61+
with:
62+
name: pypi_archives
63+
path: dist
64+
65+
- name: Create GH release
66+
uses: softprops/action-gh-release@v2
67+
with:
68+
draft: true
69+
files: dist/*
70+
71+
72+
create-pypi-release:
73+
name: Create PyPI release
74+
needs:
75+
- create-gh-release
76+
runs-on: ubuntu-24.04
77+
environment: pypi-publish
78+
permissions:
79+
id-token: write
80+
81+
steps:
82+
- name: Download built archives
83+
uses: actions/download-artifact@v4
84+
with:
85+
name: pypi_archives
86+
path: dist
87+
88+
- name: Publish to PyPI
89+
if: startsWith(github.ref, 'refs/tags')
90+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/scancode-release.yml

Lines changed: 37 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
permissions: {}
2121
jobs:
2222

23-
build_scancode_wheel_for_pypi:
23+
build_scancode_wheels_sdist_for_pypi:
2424
permissions:
2525
contents: read # to fetch code (actions/checkout)
2626

@@ -31,59 +31,25 @@ jobs:
3131
run:
3232
shell: bash
3333

34-
strategy:
35-
fail-fast: true
36-
matrix:
37-
pyver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
38-
39-
steps:
40-
- uses: actions/checkout@v4
41-
42-
- name: Set up Python on ${{ matrix.pyver }}
43-
uses: actions/setup-python@v5
44-
with:
45-
python-version: ${{ matrix.pyver }}
46-
47-
- name: Install requirements then build main and mini wheel
48-
run: etc/release/scancode-create-pypi-wheel.sh
49-
50-
- name: Collect built wheels for ${{ matrix.pyver }}
51-
uses: actions/upload-artifact@v4
52-
with:
53-
name: wheels-${{ matrix.pyver }}
54-
path: dist/*.whl
55-
56-
57-
build_scancode_sdist_for_pypi:
58-
permissions:
59-
contents: read # to fetch code (actions/checkout)
60-
61-
name: Build PyPI sdist archives
62-
runs-on: ubuntu-24.04
63-
64-
defaults:
65-
run:
66-
shell: bash
67-
68-
strategy:
69-
fail-fast: true
70-
7134
steps:
7235
- uses: actions/checkout@v4
7336

7437
- name: Set up Python
7538
uses: actions/setup-python@v5
7639
with:
77-
python-version: "3.14"
40+
python-version: 3.14
41+
42+
- name: Install requirements then build main and mini wheel, sdist
43+
run: etc/release/scancode-create-pypi-wheel-and-sdist.sh
7844

79-
- name: Install requirements then build main and mini sdist
80-
run: etc/release/scancode-create-pypi-sdist.sh
45+
- name: Install requirements then build licensedcode data/index wheels, sdist
46+
run: etc/release/licensedcode-create-pypi-wheel-and-sdist.sh
8147

82-
- name: Collect built sdist
48+
- name: Collect built wheels and sdist
8349
uses: actions/upload-artifact@v4
8450
with:
85-
name: sdists
86-
path: dist/*.tar.gz
51+
name: wheels_sdist
52+
path: dist/*
8753

8854

8955
build_scancode_for_release_linux:
@@ -229,7 +195,7 @@ jobs:
229195

230196
name: Test PyPI wheels on linux and mac
231197
needs:
232-
- build_scancode_wheel_for_pypi
198+
- build_scancode_wheels_sdist_for_pypi
233199
runs-on: ${{ matrix.os }}
234200

235201
defaults:
@@ -253,16 +219,20 @@ jobs:
253219
- name: Download wheels artifact
254220
uses: actions/download-artifact@v4
255221
with:
256-
name: wheels-${{ matrix.pyver }}
222+
name: wheels_sdist
257223
path: dist
258224

259-
- name: test install wheels
225+
- name: install and test wheels
260226
run: |
261227
echo "license: gpl-2.0" > some.file
262228
rm -rf venv; \
263229
python -m venv venv
264230
venv/bin/python -m pip install --upgrade pip wheel setuptools
265-
for f in `find dist -type f -name "*${{ matrix.pyver }}*"`; \
231+
for f in `find dist -type f -name "licensedcode*.whl"`; \
232+
do \
233+
venv/bin/python -m pip install --force-reinstall "$f" ; \
234+
done
235+
for f in `find dist -type f -name "scancode_toolkit-*.whl"`; \
266236
do \
267237
venv/bin/python -m pip install --force-reinstall "$f[full]" ; \
268238
venv/bin/scancode -clipeu --json-pp - some.file ; \
@@ -275,7 +245,7 @@ jobs:
275245

276246
name: Test PyPI wheels on Windows
277247
needs:
278-
- build_scancode_wheel_for_pypi
248+
- build_scancode_wheels_sdist_for_pypi
279249
runs-on: ${{ matrix.os }}
280250

281251
defaults:
@@ -299,15 +269,19 @@ jobs:
299269
- name: Download wheels artifact
300270
uses: actions/download-artifact@v4
301271
with:
302-
name: wheels-${{ matrix.pyver }}
272+
name: wheels_sdist
303273
path: dist
304274

305-
- name: test install wheel
275+
- name: install and test wheels
306276
run: |
307277
echo "license: gpl-2.0" > some.file
308278
python -m venv venv
309279
venv/Scripts/python.exe -m pip install --upgrade pip
310-
for f in `find dist -type f -name "*${{ matrix.pyver }}*"`; \
280+
for f in `find dist -type f -name "licensedcode*.whl"`; \
281+
do \
282+
venv/Scripts/python.exe -m pip install --force-reinstall "$f" ; \
283+
done
284+
for f in `find dist -type f -name "scancode_toolkit-*.whl"`; \
311285
do \
312286
venv/Scripts/python.exe -m pip install --force-reinstall "$f[full]" ; \
313287
venv/Scripts/scancode -clipeu --json-pp - some.file ; \
@@ -454,6 +428,7 @@ jobs:
454428
- build_scancode_for_release_windows
455429
- build_scancode_for_release_linux
456430
- build_scancode_for_release_macos
431+
- build_scancode_wheels_sdist_for_pypi
457432

458433
runs-on: ubuntu-24.04
459434
defaults:
@@ -559,6 +534,12 @@ jobs:
559534
name: windows_app_py_3.14
560535
path: dist
561536

537+
- name: Download scancode and licensedcode wheels
538+
uses: actions/download-artifact@v4
539+
with:
540+
name: wheels_sdist
541+
path: dist
542+
562543
- name: Mock GH release
563544
run: |
564545
ls -al dist
@@ -573,8 +554,7 @@ jobs:
573554
publish_to_pypi:
574555
name: Publish to PyPI
575556
needs:
576-
- build_scancode_wheel_for_pypi
577-
- build_scancode_sdist_for_pypi
557+
- build_scancode_wheels_sdist_for_pypi
578558
- smoke_test_install_and_run_pypi_wheels_on_windows
579559
- smoke_test_install_and_run_pypi_wheels_on_posix
580560
- publish_to_gh_release
@@ -585,26 +565,23 @@ jobs:
585565
defaults:
586566
run:
587567
shell: bash
588-
strategy:
589-
fail-fast: false
590-
matrix:
591-
dist_names: ["wheels-3.10", "wheels-3.11", "wheels-3.12", "wheels-3.13", "wheels-3.14", "sdists"]
592568

593569
steps:
594570
- name: Set up Python
595571
uses: actions/setup-python@v5
596572
with:
597573
python-version: 3.14
598574

599-
- name: Download a single artifact
575+
- name: scancode and licensedcode wheels
600576
uses: actions/download-artifact@v4
601577
with:
602-
name: ${{ matrix.dist_names }}
578+
name: wheels_sdist
603579
path: dist
604580

605581
- name: Mock PyPI upload
606582
run: |
607583
ls -al dist
608584
609585
- name: Publish distributions to PyPI
586+
if: startsWith(github.ref, 'refs/tags')
610587
uses: pypa/gh-action-pypi-publish@release/v1

src/licensedcode/data/README.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ScanCode LicenseDB
2+
==================
3+
4+
LicenseDB is a free and open database of mostly all the software licenses,
5+
in particular all the open source software licenses, with over 2000 curated
6+
licenses texts and their metadata.
7+
8+
LicenseDB is built from the ScanCode Toolkit license dataset and is an
9+
essential reference license resource for license compliance and SBOMs.
10+
LicenseDB includes all the SPDX and OSI licenses together with an extended
11+
curated collection of other licenses and license metadata.
12+
These licenses are carefully reviewed and curated and continusouly updated
13+
by an open community of contributors.

0 commit comments

Comments
 (0)