From 0e890ca1d579cd5da95f1c776f0cf084bfe1385a Mon Sep 17 00:00:00 2001 From: YISH Date: Sat, 28 Dec 2024 17:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20publishing=20crates.io?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/version.yml | 17 +++++++++++++++++ Cargo.toml | 4 ++-- README.md | 1 + README_zh-CN.md | 1 + justfile | 6 +++++- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index aafddf54..cc8f34e1 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -51,3 +51,20 @@ jobs: with: version: ${{ needs.bump.outputs.version }} prerelease: ${{ !contains('major, minor, patch', inputs.bump) }} + + publish: + needs: [ "bump", "build" ] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ needs.bump.outputs.version }} + + - name: Setup + uses: ./.github/actions/setup + + - name: Publish to crates.io + run: just publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index f107e955..1a5c7e27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["YISH "] edition = "2021" rust-version = "1.75.0" -keywords = ["DNS", "BIND", "dig", "named", "dnssec", "SmartDNS", "Dnsmasq"] +keywords = ["DNS", "BIND", "dig", "SmartDNS", "Dnsmasq"] categories = ["network-programming"] description = """ @@ -14,7 +14,7 @@ A cross platform local DNS server written in rust to obtain the fastest website homepage = "https://github.com/mokeyish/smartdns-rs" repository = "https://github.com/mokeyish/smartdns-rs" -license = "GPL-v3.0" +license = "GPL-3.0-only" readme = "README.md" [lints.rust] diff --git a/README.md b/README.md index 573e8564..510ce51f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # SmartDNS-rs ![Test](https://github.com/mokeyish/smartdns-rs/actions/workflows/test.yml/badge.svg?branch=main) +[![Crates.io Version](https://img.shields.io/crates/v/smartdns.svg)](https://crates.io/crates/smartdns) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/mokeyish/smartdns-rs?display_name=tag&include_prereleases)](https://github.com/mokeyish/smartdns-rs/releases) [![homebrew version](https://img.shields.io/homebrew/v/smartdns)](https://formulae.brew.sh/formula/smartdns) ![OS](https://img.shields.io/badge/os-Windows%20%7C%20MacOS%20%7C%20Linux-blue) diff --git a/README_zh-CN.md b/README_zh-CN.md index 62305b1f..9c137adc 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -1,6 +1,7 @@ # SmartDNS-rs ![Test](https://github.com/mokeyish/smartdns-rs/actions/workflows/test.yml/badge.svg?branch=main) +[![Crates.io Version](https://img.shields.io/crates/v/smartdns.svg)](https://crates.io/crates/smartdns) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/mokeyish/smartdns-rs?display_name=tag&include_prereleases)](https://github.com/mokeyish/smartdns-rs/releases) [![homebrew version](https://img.shields.io/homebrew/v/smartdns)](https://formulae.brew.sh/formula/smartdns) ![OS](https://img.shields.io/badge/os-Windows%20%7C%20MacOS%20%7C%20Linux-blue) diff --git a/justfile b/justfile index 17ac1b1e..446cfeae 100644 --- a/justfile +++ b/justfile @@ -36,6 +36,10 @@ test *args: patch check *args: patch {{cargo}} check --workspace --tests --benches --examples {{args}} +# Publish +publish *args: patch + {{cargo}} publish --no-verify + # Run clippy fix clippy: patch @@ -73,4 +77,4 @@ setcap: [private] @require_set-version: - cargo set-version --version >/dev/null 2>&1 || cargo install cargo-edit > /dev/null \ No newline at end of file + cargo set-version --version >/dev/null 2>&1 || cargo install cargo-edit > /dev/null