Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate publishing crates to crates.io #1364

Merged
merged 6 commits into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: CD
on:
release:
types: [published]
env:
CARGO_TERM_COLOR: always

jobs:
deploy:
Expand Down Expand Up @@ -61,3 +63,36 @@ jobs:
installers-regex: '\.exe$'
version: ${{ github.event.release.tag_name }}
musicinmybrain marked this conversation as resolved.
Show resolved Hide resolved
token: ${{ secrets.WINGET_TOKEN }}

cargo-publish:
name: Publish to crates.io
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
components: clippy

- name: Publish to crates.io (ascii)
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p onefetch-ascii

- name: Publish to crates.io (image)
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p onefetch-image

- name: Publish to crates.io (manifest)
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p onefetch-manifest

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish