Skip to content

Commit

Permalink
init: repo
Browse files Browse the repository at this point in the history
tests are still missing
  • Loading branch information
icepuma committed Mar 21, 2024
0 parents commit 67eff97
Show file tree
Hide file tree
Showing 10 changed files with 503 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
groups:
all-dependencies-cargo:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
all-dependencies-actions:
patterns:
- "*"
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
push:
tags:
- "v*"
name: Release
jobs:
build:
name: Release (crates.io & github.com)
runs-on: ubuntu-latest
env:
BINARY_NAME: cidrrr
CARGO_TERM_COLOR: always
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- run: cargo login ${CARGO_RELEASE_TOKEN}
env:
CARGO_RELEASE_TOKEN: ${{ secrets.CARGO_RELEASE_TOKEN }}
- run: cargo publish
- uses: docker://messense/rust-musl-cross:x86_64-musl
with:
args: cargo build --release
- uses: docker://messense/rust-musl-cross:x86_64-musl
with:
args: musl-strip target/x86_64-unknown-linux-musl/release/cidrrr
- run: cp ./target/x86_64-unknown-linux-musl/release/cidrrr cidrrr
- run: sha512sum cidrrr > cidrrr.sha512sum
- id: github_release
uses: softprops/action-gh-release@v2
with:
name: Release cidrrr ${{ github.ref_name }}
generate_release_notes: true
draft: false
prerelease: false
files: |
cidrrr
cidrrr.sha512sum
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test
on:
push:
branches:
- "main"
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- windows-2022
- macos-12
- macos-14
env:
CARGO_TERM_COLOR: always
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: cargo fmt -- --check && cargo clippy --all-targets --all-features -- -D warnings
- run: cargo test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
251 changes: 251 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "cidrrr"
version = "2024.3.21"
edition = "2021"
authors = ["Stefan Ruzitschka <[email protected]>"]
description = "Convert a CIDR block to a list of IPs"
keywords = ["ip", "cidr", "ipv4", "ipv6"]
repository = "https://github.com/icepuma/cidrrr"
readme = "README.md"
license-file = "LICENSE"

[dependencies]
clap = { version = "4", features = ["cargo", "derive"] }
ipnet = "2"
serde = { version = "1.0.197", features = ["derive"] }

[profile.release]
lto = true
strip = true
opt-level = "z"
codegen-units = 1
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Stefan Ruzitschka

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 67eff97

Please sign in to comment.