name: OSDK Publish

on:
  workflow_dispatch:
  push:
    paths:
      - osdk/Cargo.toml
    branches:
      - main

jobs:
  osdk-publish:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    container: asterinas/asterinas:0.4.2
    steps:
      - uses: actions/checkout@v4
      - uses: katyo/publish-crates@v2
        with:
          path: './osdk'
          args: --no-verify
          registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          ignore-unpublished-changes: true
