-
Notifications
You must be signed in to change notification settings - Fork 162
71 lines (59 loc) · 1.78 KB
/
Copy pathrelease.yml
File metadata and controls
71 lines (59 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Publish Release Artefacts
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Stable Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo Dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-
- name: Install Release Tooling
run: |
cargo install cargo-deny --locked
cargo install cargo-sbom --locked
- name: Verify Dependency Policy
run: cargo deny check
- name: Generate Workspace SBOM
run: cargo sbom --output-format spdxjson23 > propchain-sbom.json
- name: Validate SBOM Shape
run: |
jq -e '
.SPDXID == "SPDXRef-DOCUMENT" and
(.creationInfo.creators | length > 0) and
(.packages | length > 0) and
(.relationships | length > 0)
' propchain-sbom.json > /dev/null
- name: Upload SBOM Workflow Artifact
uses: actions/upload-artifact@v4
with:
name: propchain-sbom
path: propchain-sbom.json
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: propchain-sbom.json
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}