Skip to content

Commit

Permalink
Generate thirdparty.html (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton authored Aug 1, 2023
1 parent 55bd4f6 commit 6ca39f7
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,38 @@ jobs:
name: bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip
path: ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip
if-no-files-found: error

third_party:
name: Generate THIRDPARTY.html
runs-on: ubuntu-22.04
needs:
- setup
steps:
- name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Install rust
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e # stable
with:
toolchain: stable

- name: Cache cargo registry
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
key: cargo-cli-about

- name: Install cargo-about
run: cargo install cargo-about

- name: Generate THIRDPARTY.html
working-directory: ./crates/bws
run: |
cargo about generate ../../about.hbs > THIRDPARTY.html
sed -i.bak 's/\$NAME\$/Bitwarden Secrets Manager CLI/g' THIRDPARTY.html
- name: Upload artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: THIRDPARTY.html
path: ./crates/bws/THIRDPARTY.html
if-no-files-found: error
1 change: 1 addition & 0 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
packages/bws-aarch64-pc-windows-msvc-${{ env.PKG_VERSION }}.zip,
packages/bws-x86_64-unknown-linux-gnu-${{ env.PKG_VERSION }}.zip,
packages/bws-aarch64-unknown-linux-gnu-${{ env.PKG_VERSION }}.zip,
packages/THIRDPARTY.html,
packages/bws-sha256-checksums-${{ env.PKG_VERSION }}.txt"
commit: ${{ github.sha }}
tag: bws-v${{ env.PKG_VERSION }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ bld/
node_modules/
clients/python/env/

# Third party license
THIRDPARTY.html

# Node.js addon binary file, for the current running operating system.
crates/bitwarden-napi/sdk-napi.*.node

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ target
languages
schemas
/crates/bitwarden-napi/src-ts/bitwarden_client/schemas.ts
about.hbs
70 changes: 70 additions & 0 deletions about.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<html>

<head>
<style>
@media (prefers-color-scheme: dark) {
body {
background: #333;
color: white;
}
a {
color: skyblue;
}
}
.container {
font-family: sans-serif;
max-width: 800px;
margin: 0 auto;
}
.intro {
text-align: center;
}
.licenses-list {
list-style-type: none;
margin: 0;
padding: 0;
}
.license-used-by {
margin-top: -10px;
}
.license-text {
max-height: 200px;
overflow-y: scroll;
white-space: pre-wrap;
}
</style>
</head>

<body>
<main class="container">
<div class="intro">
<h1>Third Party Licenses</h1>
<p>This page lists the licenses of the projects used in $NAME$.</p>
</div>

<h2>Overview of licenses:</h2>
<ul class="licenses-overview">
{{#each overview}}
<li><a href="#{{id}}">{{name}}</a> ({{count}})</li>
{{/each}}
</ul>

<h2>All license text:</h2>
<ul class="licenses-list">
{{#each licenses}}
<li class="license">
<h3 id="{{id}}">{{name}}</h3>
<h4>Used by:</h4>
<ul class="license-used-by">
{{#each used_by}}
<li><a href="{{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}}">{{crate.name}} {{crate.version}}</a></li>
{{/each}}
</ul>
<pre class="license-text">{{text}}</pre>
</li>
{{/each}}
</ul>
</main>
</body>

</html>
10 changes: 10 additions & 0 deletions about.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
accepted = [
"MIT",
"ISC",
"BSD-3-Clause",
"CC0-1.0",
"Apache-2.0",
"MPL-2.0",
"LGPL-3.0",
"Unicode-DFS-2016",
]

0 comments on commit 6ca39f7

Please sign in to comment.