Skip to content

Commit

Permalink
Add setup-cargo-bundle-licenses action. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander authored Jun 5, 2024
1 parent d6c8bd2 commit 0eeb030
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ jobs:
- run: mdbook --version
- run: mdbook-linkcheck --version

setup_cargo_bundle_licenses:
name: setup-cargo-bundle-licenses [default]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Set up cargo-bundle-licenses
uses: ./setup-cargo-bundle-licenses
- run: cargo bundle-licenses --version

tests_complete:
name: All tests
if: always()
Expand All @@ -76,6 +86,7 @@ jobs:
- setup_uv_version
- setup_uv_lockfile
- setup_mdbook
- setup_cargo_bundle_licenses
runs-on: ubuntu-latest

steps:
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,19 @@ See [setup-mdbook/action.yaml] for all options.
[mdbook]: https://rust-lang.github.io/mdBook/
[mdbook-linkcheck]: https://github.com/Michael-F-Bryan/mdbook-linkcheck
[setup-mdbook/action.yaml]: setup-mdbook/action.yaml

## setup-cargo-bundle-licenses

`setup-cargo-bundle-licenses` installs [cargo-bundle-licenses].

In your action workflow:
```yaml
steps:
- name: Set up mdbook
uses: glotzerlab/workflows/setup-cargo-bundle-licenses@<insert hash of tagged version here> # v0.1.0
```

See [setup-cargo-bundle-licenses/action.yaml] for all options.

[cargo-bundle-licenses]: https://github.com/sstadick/cargo-bundle-licenses
[setup-cargo-bundle-licenses/action.yaml]: setup-cargo-bundle-licenses/action.yaml
21 changes: 21 additions & 0 deletions setup-cargo-bundle-licenses/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Set up cargo-bundle-licenses
description: Install cargo-bundle-licenses into the $PATH

inputs:
version:
description: 'cargo-bundle-licenses version to install.'
required: false
default: '1.3.0'
platform:
description: 'Download executables for the given platform.'
required: false
default: linux-amd64

runs:
using: "composite"
steps:
- name: Install cargo-bundle-licenses
run: |
curl -sSL "https://github.com/sstadick/cargo-bundle-licenses/releases/download/v${{ inputs.version }}/cargo-bundle-licenses-${{ inputs.platform }}" -o "$HOME/.cargo/bin/cargo-bundle-licenses"
chmod a+x "$HOME/.cargo/bin/cargo-bundle-licenses"
shell: bash
2 changes: 1 addition & 1 deletion setup-mdbook/action.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Setup mdbook
name: Set up mdbook
description: Install mdbook and optional mdbook plugins.

inputs:
Expand Down
2 changes: 1 addition & 1 deletion setup-uv/action.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Setup uv
name: Set up uv
description: Install uv and synchronize the environment with a given lock file.

inputs:
Expand Down

0 comments on commit 0eeb030

Please sign in to comment.