Skip to content

Commit 022e8c6

Browse files
committed
Add function to create api package version response file path
* Update github actions Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent 31ca84c commit 022e8c6

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/docs-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on: [push, pull_request]
55
jobs:
66
build:
77
runs-on: ubuntu-24.04
8+
permissions:
9+
contents: read
810

911
strategy:
1012
max-parallel: 4

.github/workflows/pypi-release.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: python -m twine check dist/*
4343

4444
- name: Upload built archives
45-
uses: actions/upload-artifact@v4
45+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
4646
with:
4747
name: pypi_archives
4848
path: dist/*
@@ -56,15 +56,16 @@ jobs:
5656

5757
steps:
5858
- name: Download built archives
59-
uses: actions/download-artifact@v4
59+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
6060
with:
6161
name: pypi_archives
6262
path: dist
6363

6464
- name: Create GH release
65-
uses: softprops/action-gh-release@v2
65+
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
6666
with:
6767
draft: true
68+
generate_release_notes: true
6869
files: dist/*
6970

7071

@@ -79,11 +80,14 @@ jobs:
7980

8081
steps:
8182
- name: Download built archives
82-
uses: actions/download-artifact@v4
83+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
8384
with:
8485
name: pypi_archives
8586
path: dist
8687

8788
- name: Publish to PyPI
88-
if: startsWith(github.ref, 'refs/tags')
89-
uses: pypa/gh-action-pypi-publish@release/v1
89+
if: startsWith(github.ref, 'refs/tags/')
90+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
91+
with:
92+
verbose: true
93+
password: ${{ secrets.PYPI_API_TOKEN_ABOUTCODE_FEDERATED }}

src/aboutcode/federated/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@
383383

384384
KIND_PURLS_FILENAME = "purls.yml"
385385
KIND_VULNERABILITIES_FILENAME = "vulnerabilities.yml"
386-
KIND_API_PACKAGE_METADATA_FILENAME = "api_package_metadata.yml"
386+
KIND_API_PACKAGE_METADATA_FILENAME = "api_package_metadata.json"
387+
KIND_API_VERSION_RESPONSE_FILENAME = "api_package_version_response.json"
387388

388389

389390
def get_package_purls_yml_file_path(purl: Union[PackageURL, str]):
@@ -407,6 +408,13 @@ def get_api_package_metadata_file_path(purl: Union[PackageURL, str]):
407408
return get_package_base_dir(purl) / KIND_API_PACKAGE_METADATA_FILENAME
408409

409410

411+
def get_api_package_version_response_file_path(purl: Union[PackageURL, str]):
412+
"""
413+
Return the path to a Package api_package_version_response.yml YAML for a purl.
414+
"""
415+
return get_package_base_dir(purl) / KIND_API_VERSION_RESPONSE_FILENAME
416+
417+
410418
def get_package_base_dir(purl: Union[PackageURL, str]):
411419
"""
412420
Return the base path to a Package directory (ignoring version) for a purl

0 commit comments

Comments
 (0)