fdncred / nu_plugin_json_path

A nushell plugin for parsing json that uses the json path specification.
MIT License
14 stars 1 forks source link

Publish as a crate #4

Open NonlinearFruit opened 4 months ago

NonlinearFruit commented 4 months ago

This plugin is super helpful. Using it in a CI/CD pipeline is a little rough with the current install steps. Doing a cargo install with register would be great

fdncred commented 4 months ago

I have no idea how to publish crates. Never done it.

NonlinearFruit commented 4 months ago

Here are a couple examples:

Starship (workflow)

  cargo_publish:
    name: Publish Cargo Package
    runs-on: ubuntu-latest
    needs: [release_please, upload_artifacts]
    if: ${{ needs.release_please.outputs.release_created == 'true' }}
    steps:
      - name: Setup | Checkout
        uses: actions/checkout@v4

      - name: Setup | Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Build | Publish
        run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

mdBook (workflow)

  publish:
    name: Publish to crates.io
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Install Rust (rustup)
        run: rustup update stable --no-self-update && rustup default stable
      - name: Publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: cargo publish --no-verify

And the docs for publishing to crates.io (docs)