-
-
Notifications
You must be signed in to change notification settings - Fork 45
41 lines (37 loc) · 1.52 KB
/
deploy_cargo_cyclonedx.yml
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
name: Deploy cargo-cyclonedx to Crates.io
on:
workflow_dispatch:
inputs:
releaseType:
description: "cargo-cyclonedx release type (major, minor, patch)"
required: true
default: "patch"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: JQ
run: |
sudo apt-get install -y jq
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Cargo bump
run: |
cargo install cargo-edit
cargo set-version --package cargo-cyclonedx --bump ${{ github.event.inputs.releaseType }}
- name: Retrieve new version
run: |
echo "::set-output name=CARGO_VERSION::$(cargo metadata | jq -r '.packages[] | select(.name == "cargo-cyclonedx") | .version')"
id: version
- name: Build one time, for sanity
run: cargo build
- name: Publish
run: cargo publish --token ${{ secrets.CARGO_API_KEY }} --package cargo-cyclonedx --verbose --allow-dirty
- name: Configure git and add files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "New development bump of cargo-cylonedx to ${{steps.version.outputs.CARGO_VERSION}}"
git tag -a "cargo-cyclonedx-${{steps.version.outputs.CARGO_VERSION}}" -m "cargo-cyclonedx ${{steps.version.outputs.CARGO_VERSION}} release"
git push --follow-tags