Comments (12)
Probably the best way would be to extend the semantic-release context object used in the template, splitting the major.minor.patch into the following:
nextRelease.major
nextRelease.minor
nextRelease.patch
enabling __VERSION__ = "v${nextRelease.major}"
similar to what you want.
from semantic-release-replace-plugin.
Would get this for free if it was extended in semantic-release.
from semantic-release-replace-plugin.
Something along the lines of semantic-release/semantic-release#2128.
from semantic-release-replace-plugin.
But, it'd still require some changes in this repo for detection/confirmation, i think?
v1.2.3 -> v1.2.4 is v1 -> v1
v1.2.3 -> v2.0.0 is v1 -> v2
How would you set up?
"results": [
{
"file": "foo/__init__.py",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
or does this still work maybe since it replaced the version (same version to same version)?
from semantic-release-replace-plugin.
And thanks for putting versions in the upstream. That'd be super useful in other plugins.
from semantic-release-replace-plugin.
or does this still work maybe since it replaced the version (same version to same version)?
I think it would still work.
And thanks for putting versions in the upstream.
We'll see if I can figure out the failing tests. 😄
Maybe fresh eyes tomorrow will help!
from semantic-release-replace-plugin.
__VERSION__ = "v${nextRelease.version.split('.')[0]}"
Should get what you want.
from semantic-release-replace-plugin.
Hmm, I'm actually getting error when the major version does not change.
[4:16:47 PM] [semantic-release] › ✖ An error occurred while running semantic-release: Error: Expected match not found!
Error: Error: Expected match not found!
- Expected
+ Received
Array [
Object {
"file": "Dockerfile",
- "hasChanged": false,
+ "hasChanged": true,
"numMatches": 1,
- "numReplacements": 0,
+ "numReplacements": 1,
},
]
- Expected
+ Received
Array [
Object {
"file": "Dockerfile",
- "hasChanged": false,
+ "hasChanged": true,
"numMatches": 1,
- "numReplacements": 0,
+ "numReplacements": 1,
},
]
at /home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@google/semantic-release-replace-plugin/dist/index.js:98:35
at step (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@google/semantic-release-replace-plugin/dist/index.js:59:23)
at Object.next (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@google/semantic-release-replace-plugin/dist/index.js:40:53)
at fulfilled (/home/runner/work/_actions/cycjimmy/semantic-release-action/v2/node_modules/@google/semantic-release-replace-plugin/dist/index.js:31:58) {
pluginName: '@google/semantic-release-replace-plugin'
}
from semantic-release-replace-plugin.
probably need to remove the results from your config as it will depend on the version.
from semantic-release-replace-plugin.
doesn't that mean no validation?
from semantic-release-replace-plugin.
After removing the config, I'm still getting the error.
[5:31:47 PM] [semantic-release] › ✖ An error occurred while running semantic-release: Error: Expected match not found!
Error: Error: Expected match not found!
- Expected
+ Received
Array [
Object {
"file": "Dockerfile",
- "hasChanged": false,
"numMatches": 1,
- "numReplacements": 0,
},
]
- Expected
+ Received
Array [
Object {
"file": "Dockerfile",
- "hasChanged": false,
"numMatches": 1,
- "numReplacements": 0,
},
]
from semantic-release-replace-plugin.
Removing the "results" field completely was successful, now I guess there's no validation then.
from semantic-release-replace-plugin.
Related Issues (12)
- Multiline mode HOT 3
- Feature request to target only specific branches HOT 1
- matches not found in google action HOT 3
- Conditional replace file HOT 5
- Skip step "prepare" of plugin "@google/semantic-release-replace-plugin" in dry-run mode HOT 4
- Error running on Gitlab CI HOT 2
- Error [ERR_REQUIRE_ESM]: require() of ES Module HOT 10
- Cannot find module 'semantic-release-replace-plugin' HOT 11
- Release `1.2.7` should be a major release, or at the very least a minor HOT 1
- Match not found semantic-release-replace-plugin HOT 1
- Increment value HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semantic-release-replace-plugin.