Publish Strips '+' Suffix From Version #69
-
|
Sometimes we use a re-publishing pattern where we append When executing the Note also that a suffix like Plugin ConfignpmPublish {
organization.set("testingstuff")
version.set("${project.version}")
registries {
github {
access.set(RESTRICTED)
dry.set(true)
}
}
packages {
val js by getting {
packageName.set("a-test")
}
}
}Github Actionname: Publish
on:
release:
types:
- published
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: "adopt-hotspot"
java-version: "11.0.11+9"
- name: Publish Dump Info
run: |
env
- name: PublishShowVer
run: >
echo
"GITHUB_REF tag is: "
-Pversion=${GITHUB_REF/refs\/tags\//}
- name: Pack Npm
run: >
./gradlew
-Pversion="${GITHUB_REF/refs\/tags\//}"
packJsPackage
- name: Publish Npm
run: >
./gradlew
-Pversion="${GITHUB_REF/refs\/tags\//}"
-Pnpm.publish.registry.github.authToken="test-token"
publishJsPackageToGithubRegistryOutput For v1.0.3-1 ✅Output For v1.0.2+1 ⛔Note the |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments
-
|
@mpetuska I have a test repo setup to demonstrate the issue, let me know if you'd like access to that repo if it would help you debug. |
Beta Was this translation helpful? Give feedback.
-
|
Can you clarify which npm-publish version are you using? |
Beta Was this translation helpful? Give feedback.
-
3.0.0 |
Beta Was this translation helpful? Give feedback.
-
|
Ah, in that case I suspect it's npm issue, given that it's not affecting pack tasks (which since 3.0.0 determine the version themselves as opposed to delegating to the npm) |
Beta Was this translation helpful? Give feedback.
-
|
More info here. I think even pack task does not work correctly, have a look at the package.json inside - it should have version trimmed as well. |
Beta Was this translation helpful? Give feedback.
-
|
Pack appears to work ok: I will check the node |
Beta Was this translation helpful? Give feedback.
-
|
I meant check the package.json file inside the generated .tgz file. Here's a quick refresher on task outputs:
|
Beta Was this translation helpful? Give feedback.
-
|
FYI, the plugin already handles Maybe that alone would be sufficient for your needs? |
Beta Was this translation helpful? Give feedback.
-
|
The version inside the But you are probably correct that it is an The semver specification allows for this but I suppose it is treated differently: We will have to stop using the Thank you @mpetuska for finding that out! |
Beta Was this translation helpful? Give feedback.
-
|
Phew, I'm just glad that it's not a plugin issue 😆 |
Beta Was this translation helpful? Give feedback.
-
|
Turns out it's a "feature" of See also: npm/cli#1479 |
Beta Was this translation helpful? Give feedback.
-
|
Lol, why am I not surprised?.. |
Beta Was this translation helpful? Give feedback.
The version inside the
tgzis correct, and also shows"version": "1.0.2+1".But you are probably correct that it is an
npmproblem, because thesemverpackage strips it when parsing:The semver specification allows for this but I suppose it is treated differently:
https://semver.org/#spec-item-10
We will have to stop using the
+extensions I suppose. :-)Thank you @mpetuska for finding that out!