-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adiciona lançamento automático do crate (#34)
* starts deployment workflow * fixes imports * adds metadata * updates Cargo.toml * adds deployment workflow
- Loading branch information
1 parent
872c417
commit 5e46841
Showing
5 changed files
with
59 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: deploy | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Faz checkout no Pull Request | ||
uses: actions/checkout@v3 | ||
|
||
- name: Instala o Nix | ||
run: | | ||
BASE_URL='https://raw.githubusercontent.com/ES-Nix/get-nix/' \ | ||
&& SHA256=87fa0f1dbfdd28a1f99b39d5bd4dcc39de97bc64 \ | ||
&& NIX_RELEASE_VERSION='2.10.2' \ | ||
&& curl -fsSL "${BASE_URL}""$SHA256"/get-nix.sh | sh -s -- ${NIX_RELEASE_VERSION} \ | ||
&& . "$HOME"/.nix-profile/etc/profile.d/nix.sh \ | ||
&& . ~/."$(basename $SHELL)"rc \ | ||
&& export TMPDIR=/tmp \ | ||
&& nix flake --version \ | ||
&& nix registry pin nixpkgs github:NixOS/nixpkgs/ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b \ | ||
&& curl -fsSL https://raw.githubusercontent.com/ES-Nix/get-nix/"$SHA256"/install_direnv_and_nix_direnv.sh | sh \ | ||
&& . ~/."$(basename $SHELL)"rc \ | ||
&& direnv --version | ||
echo "$HOME"/.nix-profile/bin >> $GITHUB_PATH | ||
- name: Build | ||
run: nix develop .# --command sh -c 'cd brado && cargo build --release --verbose' | ||
|
||
- name: Deploy | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
run: nix develop .# --command sh -c 'cd brado && cargo login --registry $CARGO_REGISTRY_TOKEN && cargo publish' |
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
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
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 |
---|---|---|
|
@@ -2,4 +2,3 @@ pub mod cnpj; | |
pub mod common; | ||
pub mod cpf; | ||
pub mod doc; | ||
pub use doc::Document; |
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,4 +1,15 @@ | ||
//! # brado documentation | ||
//! | ||
//! brado is a brazilian docs validator. | ||
//! | ||
//! ## Example | ||
//! ``` | ||
//! use brado; | ||
//! use brado::Document; | ||
//! let cpf_doc: Document = Document::new("639.292.470-11"); | ||
//! brado::cpf::validate(&cpf_doc, true, false); | ||
//! ``` | ||
mod docs; | ||
pub use crate::docs::cnpj; | ||
pub use crate::docs::cpf; | ||
pub use crate::docs::Document; | ||
pub use crate::docs::doc::Document; |