Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Cargo Publish Issues #256

Open
jio-gl opened this issue Oct 10, 2023 · 3 comments · May be fixed by #259
Open

Resolve Cargo Publish Issues #256

jio-gl opened this issue Oct 10, 2023 · 3 comments · May be fixed by #259
Assignees
Labels
bug Something isn't working

Comments

@jio-gl
Copy link
Contributor

jio-gl commented Oct 10, 2023

Expected Behavior

Actual Behavior

in CI cargo publish gives Error: Error: Missing dependency 'sbtc-core' version field.

Docs: https://github.com/marketplace/actions/publish-crates

Action Code: https://github.com/katyo/publish-crates/blob/2fcfbf70241f794be7050d083dccec4edc27d754/src/package.ts#L36

Steps to Reproduce

Screenshots or Videos

@jio-gl jio-gl added the bug Something isn't working label Oct 10, 2023
@jio-gl jio-gl self-assigned this Oct 10, 2023
@jio-gl jio-gl linked a pull request Oct 10, 2023 that will close this issue
8 tasks
@jio-gl
Copy link
Contributor Author

jio-gl commented Oct 10, 2023

Exploring some solutions in the Branch, the cargo publish is working locally for sbtc-core and sbtc-cli, but the Github Action is still throwing an error about dependency sbtc-core version missing:

Error: Error: Missing dependency 'sbtc-core' version field

The GH Action mentions these checks:

  • Reads manifests to get info about crates and dependencies
  • Checks versions of external dependencies to be exists in registry
  • Checks matching paths and versions of internal dependencies
  • Checks that no changes happened since published release when version of internal dependency is not changed

@jio-gl
Copy link
Contributor Author

jio-gl commented Oct 18, 2023

I think it can be solved by leaving the path field and removing the version field for dev deps that are part of the workspace. We have to make sure that the workspace deps are dev-dependencies:

https://github.com/katyo/publish-crates/blob/2fcfbf70241f794be7050d083dccec4edc27d754/src/package.ts#L120C17-L128C22

} else if (
                    // throw an error if there is no path or version on dev-dependencies
                    kind === 'dev' &&
                    no_version &&
                    !dependency.path
                ) {
                    throw new Error(
                        `Missing dependency '${name}' version field`
                    )

@jio-gl
Copy link
Contributor Author

jio-gl commented Oct 18, 2023

Use cargo check --workspace to parse and find workspace Cargo.toml problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Triage
Development

Successfully merging a pull request may close this issue.

1 participant