From 8b44daee4c16dad79dbc4ea61c4d28bcfd0d97b6 Mon Sep 17 00:00:00 2001 From: Arthur Rocha de Menezes Date: Fri, 14 Feb 2025 16:01:34 -0300 Subject: [PATCH 1/2] feat: basic gh action to cargo publish --- .github/workflows/publish.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ff1e27a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,41 @@ +name: Publish to Crate.io + +on: + tags: + - 'v-*' + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - run: nix flake check + + build: + needs: check + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - run: nix build + + publish: + needs: + - test + - build + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: nix build + - name: cargo publish + run: |- + cargo publish --dry-run \ + --all-features \ + --target=${{ vars.PUBLISH_BUILD_TARGET }} \ + --token=${{ secrets.CRATES_IO_API_TOKEN }} From 3ff374cdaa0c4cee5cb0d87185bfc4380fc4793b Mon Sep 17 00:00:00 2001 From: Arthur Rocha de Menezes Date: Fri, 14 Feb 2025 16:02:12 -0300 Subject: [PATCH 2/2] chore: add repository to Cargo.toml --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index b72fa7e..a930a71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ categories = ["encoding"] edition = "2024" license = "MIT OR Apache-2.0" readme = "README.md" +repository = "https://github.com/cfcosta/muhex" [dependencies] serde = { version = "*", optional = true }