Skip to content

Commit

Permalink
Merge pull request #94 from bact/updatae-readme-dir
Browse files Browse the repository at this point in the history
Update spdx3.0 dir name in validation; Update READMEs for v3.0
  • Loading branch information
kestewart authored Aug 14, 2024
2 parents 39f65de + fa6c936 commit b3629dc
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 17 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@ jobs:
SPDX_Validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout spdx-examples
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7

- name: Look for files that are not checked
- name: Look for files with the wrong location
run: |
find . \( -name '*.spdx' -o -name '*.json' \) \
-not -path './presentations/*' \
-not -path './tools-java/*' \
-not -path '*/spdx2.2/*' \
-not -path '*/spdx2.3/*' \
-not -path '*/spdx-3.0/*' > flist.txt
-not -path '*/spdx3.0/*' > flist.txt
if [ "$(cat flist.txt | wc -l)" != "0" ]; then
echo "SPDX JSON files are only expected in these locations:"
echo "./presentations/"
echo "./tools-java/"
echo "*/spdx2.2/"
echo "*/spdx2.3/"
echo "*/spdx3.0/"
echo ""
echo "The following files are in the wrong location and will not be checked:"
cat flist.txt
exit 1
Expand All @@ -29,6 +37,10 @@ jobs:
find . -name '*.jsonld' > flist.txt
if [ "$(cat flist.txt | wc -l)" != "0" ]; then
echo "SPDX JSON can only has these extensions:"
echo "*.spdx"
echo "*.json"
echo ""
echo "The following files have the wrong extension and will not be checked:"
cat flist.txt
exit 1
Expand Down Expand Up @@ -63,7 +75,7 @@ jobs:
SPDX30_SCHEMA_URL="https://spdx.org/schema/3.0.0/spdx-json-schema.json"
SPDX30_SHACL_URL="https://spdx.org/rdf/3.0.0/spdx-model.ttl"
for f in $(find . -type f -path '*/spdx-3.0/*.json'); do
for f in $(find . -type f -path '*/spdx3.0/*.json'); do
echo "Checking $f..."
check-jsonschema -v --schemafile $SPDX30_SCHEMA_URL $f
pyshacl -s $SPDX30_SHACL_URL -e $SPDX30_SHACL_URL $f
Expand Down
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,17 @@ tags
# Persistent undo
[._]*.un~

# macOS
.DS_Store
.AppleDouble
.LSOverride
._*

# Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
42 changes: 33 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
# SPDX Usage Examples

This repository includes demonstrations of [SPDX](https://spdx.dev) for various scenarios and use cases.
This repository includes demonstrations of [SPDX](https://spdx.dev) for various
scenarios and use cases.

The repository is organized by profiles which represents a set of scenarios and use cases for a particular domain (e.g. security, license compliance).
Each directory contains a README.md file describing the profile and the examples contained within that directory.
The repository is organized by profiles which represents a set of scenarios and
use cases for a particular domain (e.g. security, license compliance).
Each directory contains a README.md file describing the profile and the
examples contained within that directory.

The presentations directory contains examples included in various SPDX presentations.
The [`presentations`](./presentations/) directory contains examples included in
various SPDX presentations.

Please note that this repository does not contain all of the supported fields nor all of the supported serialization formats in the latest version of the spec. Please see the [SPDX Specification Examples](https://github.com/spdx/spdx-spec/tree/development/v2.3.1/examples) for the latest and examples that contain all of the supported fields and formats.
Please note that this repository does not contain all of the supported fields
nor all of the supported serialization formats in the latest version of the
specification.

Additional version-specific examples can be found in the `examples` directory
of each specification version:

- [v3.0.1](https://github.com/spdx/spdx-spec/tree/development/v3.0.1/examples)
- [v2.3.1](https://github.com/spdx/spdx-spec/tree/development/v2.3.1/examples)

More guidance on using SPDX, including how to use SPDX license list short
identifiers in source files and leverage SPDX for compliance with standards and
regulations, is available in the [`spdx/using`](https://github.com/spdx/using/)
repository.

## Licenses

Copyright Contributors to the spdx-examples project.

Unless otherwise specified, source code in this repository is licensed under the GNU General Public License, Version 3 or later (GPL-3.0-or-later). A copy is included in the COPYING file.
Unless otherwise specified, source code in this repository is licensed under
the GNU General Public License, Version 3 or later (GPL-3.0-or-later).
A copy is included in the COPYING file.

Other licenses may be specified as well for certain files for purposes of illustration or where third-party components are used.
Other licenses may be specified as well for certain files for purposes of
illustration or where third-party components are used.

Documentation in this repository is licensed under the Creative Commons Attribution 4.0 International license (CC-BY-4.0), available at https://creativecommons.org/licenses/by/4.0/.
Documentation in this repository is licensed under the Creative Commons
Attribution 4.0 International license (CC-BY-4.0), available at
<https://creativecommons.org/licenses/by/4.0/>.

SPDX documents in this repository are provided under CC0 1.0 Universal (CC0-1.0), available at https://creativecommons.org/publicdomain/zero/1.0/.
SPDX documents in this repository are provided under CC0 1.0 Universal
(CC0-1.0), available at
<https://creativecommons.org/publicdomain/zero/1.0/>.
4 changes: 4 additions & 0 deletions ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX AI Profile Usage Examples

This repository includes demonstrations of [SPDX documents](https://spdx.dev)
for various examples of AI applications and models.
File renamed without changes.
8 changes: 5 additions & 3 deletions software/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ The examples include source code and built / packaged binaries for a variety of

Directories of the form `example#` are structured as follows:

- `content/src/`: contains the example's source code
- `content/build/`: contains the example's built artifacts
- `spdx/`: contains one or more SPDX documents (in tag-value or JSON format) for the sources and the build artifacts
- `content/src/`: contains the example's source code
- `spdx2.2/`: contains one or more SPDX 2.2 documents (in tag-value or JSON
format) for the sources and the build artifacts
- `spdx3.0/`: contains one or more SPDX 3.0 documents for the sources and the
build artifacts
- `README.md`: more details about the particular example

Each directory contains build metadata which is used to create the build artifacts. It assumes that the necessary tools (make, gcc, etc.) are present on your system, and doesn't do any autoconfiguration or the like.
Expand All @@ -32,4 +35,3 @@ Each directory contains build metadata which is used to create the build artifac
| 11 | 1 Rust file | compiled with Cargo | 1 document | SBOM describing both source and artifact, related with GENERATED_FROM |
| 12 | 1 Ruby library | built using `bundle` | 1 document | SBOM describing Ruby library packaged in a gem |
| 13 | Bundled app with a package and container | No compiling - hypothetical example | Documents in progress | SBOM describing a hypothetical "Acme Aplication" |

5 changes: 4 additions & 1 deletion software/example13/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@

This is a hypothetical example of a "simple" piece of software, Acme Application version 1.3. This example shows what an SPDX-3.0 document looks like for said Acme Application. The idea for this example is that other profiles will be able to build on top of this and demonstrate how all the profiles can work in harmony.

In this specific example, Acme Application is a bundled and distributed piece of software. When Acme Application is run, it pulls in the `alpine:latest` container image which runs in parallel to the `npm-elliptic` library that is packaged and distributed within the Acme Application binary. Among others not depicted for the sake of simplicity, `openssl` is a package included in the `alpine:latest` container image. The example-13 SBOM describes the Acme Application top level piece of software.
In this specific example, Acme Application is a bundled and distributed piece of software. When Acme Application is run, it pulls in the `alpine:latest` container image which runs in parallel to the `npm-elliptic` library that is packaged and distributed within the Acme Application binary. Among others not depicted for the sake of simplicity, `openssl` is a package included in the `alpine:latest` container image.
The [example13 SBOM](./spdx3.0/example13.spdx3.json) describes the Acme Application top level piece of software.

![A diagram of Acme Application](./example13.png "A diagram of Acme Application")
File renamed without changes.
File renamed without changes

0 comments on commit b3629dc

Please sign in to comment.