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

Publish as a Cargo package with explicit binary and library targets #19

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
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
57 changes: 54 additions & 3 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,31 @@ jobs:
with:
path: litra_${{ steps.sanitise_ref.outputs.value }}_${{ matrix.job.binary_name }}
name: litra_${{ steps.sanitise_ref.outputs.value }}_${{ matrix.job.binary_name }}
release:
cargo_publish_dry_run:
name: Publish with Cargo in dry-run mode
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install libudev-dev
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: Cache Rust dependencies
uses: actions/[email protected]
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- name: Install latest Rust nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustc, cargo
toolchain: nightly
override: true
- name: Publish to Crates.io
run: cargo publish --dry-run
create_github_release:
name: Create release with binary assets
runs-on: ubuntu-latest
needs: build
Expand Down Expand Up @@ -83,7 +107,7 @@ jobs:
publish_on_homebrew:
name: Publish release on Homebrew
runs-on: ubuntu-latest
needs: release
needs: create_github_release
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Get released version
Expand All @@ -97,4 +121,31 @@ jobs:
push-to: timrogers/homebrew-tap
create-pullrequest: true
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
cargo_publish:
name: Publish with Cargo to Crates.io
runs-on: ubuntu-latest
needs:
- create_github_release
- cargo_publish_dry_run
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Install libudev-dev
run: sudo apt-get update && sudo apt-get install libudev-dev
- name: Cache Rust dependencies
uses: actions/[email protected]
with:
path: target
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.OS }}-build-
- name: Install latest Rust nightly
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustc, cargo
toolchain: nightly
override: true
- name: Publish to Crates.io
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
name = "litra"
version = "0.2.1"
edition = "2021"
authors = ["Tim Rogers <[email protected]>"]
description = "Control your Logitech Litra light from the command line"
repository = "https://github.com/timrogers/litra-rs"
license = "MIT"
readme = "README.md"
categories = ["hardware-support", "command-line-utilities"]
keywords = ["logitech", "litra", "glow", "beam", "light"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
Loading
Loading