-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #724 from Shnatsel/main
Rewrite and simplify crates.io publishing actions
- Loading branch information
Showing
2 changed files
with
9 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,15 @@ | ||
name: Deploy cargo-cyclonedx to Crates.io | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseType: | ||
description: "cargo-cyclonedx release type (major, minor, patch)" | ||
required: true | ||
default: "patch" | ||
push: | ||
tags: | ||
- 'cargo-cyclonedx-[0-9]+.[0-9]+.[0-9]+*' | ||
|
||
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 | ||
run: cargo publish --token ${{ secrets.CARGO_API_KEY }} --package cargo-cyclonedx --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,15 @@ | ||
name: Deploy cyclonedx-bom to Crates.io | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseType: | ||
description: "cyclonedx-bom release type (major, minor, patch)" | ||
required: true | ||
default: "patch" | ||
push: | ||
tags: | ||
- 'cyclonedx-bom-[0-9]+.[0-9]+.[0-9]+*' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: JQ | ||
run: | | ||
sudo apt-get install -y jq | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Cargo bump | ||
run: | | ||
cargo install cargo-edit | ||
cargo set-version --package cyclonedx-bom --bump ${{ github.event.inputs.releaseType }} | ||
- name: Retrieve new version | ||
run: | | ||
echo "::set-output name=CARGO_VERSION::$(cargo metadata | jq -r '.packages[] | select(.name == "cyclonedx-bom") | .version')" | ||
id: version | ||
- name: Build one time, for sanity | ||
run: cargo build | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Publish | ||
run: cargo publish --token ${{ secrets.CARGO_API_KEY }} --package cyclonedx-bom --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 cyclonedx-bom to ${{steps.version.outputs.CARGO_VERSION}}" | ||
git tag -a "cyclonedx-bom-${{steps.version.outputs.CARGO_VERSION}}" -m "cyclonedx-bom ${{steps.version.outputs.CARGO_VERSION}} release" | ||
git push --follow-tags | ||
run: cargo publish --token ${{ secrets.CARGO_API_KEY }} --package cyclonedx-bom --verbose |