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

Workflow fails when snippets package version is already in the registry #38

Closed
PieterjanDeClippel opened this issue May 24, 2023 · 2 comments

Comments

@PieterjanDeClippel
Copy link

PieterjanDeClippel commented May 24, 2023

publish-vscode-extension Version Operating System
v1 ubuntu-latest

Description

Adding more on this issue.
IMHO the workflow should not error when a package version already exists in the registry.
I have a monorepo with multiple libraries and one snippets package.
Making changes to a library makes the workflow fail since the snippets package wasn't modified, and thus is still on the same version.

Expected Behavior

The workflow should succeed also when the snippets extension is already in the registry.

Actual Behavior

The workflow fails when changing other files in the workspace

image

Steps to Reproduce

Everything is hosted here
Error is thrown here

        if (extension && extension.versions) {
            const sameVersion = extension.versions.filter(v => v.version === manifest.version);
            if (sameVersion.length > 0) {
                if (options.skipDuplicate) {
                    util_2.log.done(`Version ${manifest.version} is already published. Skipping publish.`);
                    return;
                }
                if (sameVersion.some(v => v.targetPlatform === options.target)) {
/* Here */          throw new Error(`${description} already exists.`);
                }
            }
            try {
                await api.updateExtension(undefined, packageStream, manifest.publisher, manifest.name);
            }
            catch (err) {

This code comes from here

Context

Run HaaLeo/publish-vscode-extension@v1
  with:
    packagePath: libs/mintplayer-ng-bootstrap-snippets
    pat: ***
    registryUrl: https://marketplace.visualstudio.com
    yarn: false
    dryRun: false
    noVerify: false
    preRelease: false
    dependencies: true
Specifically, running GitHub Action HaaLeo/publish-vscode-extension@v1.3.0.
Package the Extension
Publish the Extension
Error: Error: MintPlayer.mintplayer-ng-bootstrap-snippets v16.0.1 already exists.
    at _publish (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:5098:[2](https://github.com/MintPlayer/mintplayer-ng-bootstrap/actions/runs/5065996309/jobs/9095228526#step:36:2)7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async publish (/home/runner/work/_actions/HaaLeo/publish-vscode-extension/v1/dist/index.js:50[3](https://github.com/MintPlayer/mintplayer-ng-bootstrap/actions/runs/5065996309/jobs/9095228526#step:36:3)[7](https://github.com/MintPlayer/mintplayer-ng-bootstrap/actions/runs/5065996309/jobs/9095228526#step:36:7):13)
PieterjanDeClippel added a commit to PieterjanDeClippel/publish-vscode-extension that referenced this issue May 24, 2023
@HaaLeo
Copy link
Owner

HaaLeo commented Jun 13, 2023

hi @PieterjanDeClippel thx for your contribution. I cannot say when I am gonna have time to review the PR. Therefore, I kindly ask you to be patient until I reviewed it.

@HaaLeo
Copy link
Owner

HaaLeo commented Jul 5, 2023

released with v1.4.0

@HaaLeo HaaLeo closed this as completed Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants