diff --git a/.github/workflows/dependency-update.yaml b/.github/workflows/dependency-update.yaml deleted file mode 100644 index 95c2d97..0000000 --- a/.github/workflows/dependency-update.yaml +++ /dev/null @@ -1,49 +0,0 @@ -on: - workflow_dispatch: - schedule: - - cron: '0 0 */2 * *' - -name: Update dependencies - -jobs: - update: - runs-on: ubuntu-latest - steps: - - name: Setup Nushell - uses: hustcer/setup-nu@main - with: - version: "*" - - uses: actions/checkout@v2 - - name: prepare - shell: nu {0} - run: | - nu -c ' - cargo install cargo-edit cargo-upgrades nu_plugin_inc -f - ' - - name: Update Dependencies - shell: nu {0} - run: | - nu -c ' - register /home/runner/.cargo/bin/nu_plugin_inc - cargo upgrade - let changed = git status -s | is-empty | not $in - if ($changed) { - open Cargo.toml - | upsert package.version ( $in - | get package.version - | inc --patch - ) - | save Cargo.toml -f - - open package.nuon - | upsert version ( open Cargo.toml | get package.version ) - | save package.nuon -f - cargo upgrade - } - - echo { "changed": $changed } - ' - - - uses: EndBug/add-and-commit@v9 - with: - author_name: GitHub-Action diff --git a/.github/workflows/publish_crate.yaml b/.github/workflows/publish_crate.yaml new file mode 100644 index 0000000..5418654 --- /dev/null +++ b/.github/workflows/publish_crate.yaml @@ -0,0 +1,30 @@ +name: Publish Crate + +on: + push: + branches: + - main + paths: + - Cargo.tom + release: + workflow_dispatch: + + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Publish to crates.io + uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}