Giter VIP home page Giter VIP logo

Comments (12)

jpoehnelt avatar jpoehnelt commented on June 2, 2024

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.

jpoehnelt avatar jpoehnelt commented on June 2, 2024

Would get this for free if it was extended in semantic-release.

from semantic-release-replace-plugin.

jpoehnelt avatar jpoehnelt commented on June 2, 2024

Something along the lines of semantic-release/semantic-release#2128.

from semantic-release-replace-plugin.

kkweon avatar kkweon commented on June 2, 2024

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.

kkweon avatar kkweon commented on June 2, 2024

And thanks for putting versions in the upstream. That'd be super useful in other plugins.

from semantic-release-replace-plugin.

jpoehnelt avatar jpoehnelt commented on June 2, 2024

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.

jpoehnelt avatar jpoehnelt commented on June 2, 2024
__VERSION__ = "v${nextRelease.version.split('.')[0]}"

Should get what you want.

from semantic-release-replace-plugin.

kkweon avatar kkweon commented on June 2, 2024

Hmm, I'm actually getting error when the major version does not change.

  • example log: here
  • releaserc config: here
[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.

jpoehnelt avatar jpoehnelt commented on June 2, 2024

probably need to remove the results from your config as it will depend on the version.

from semantic-release-replace-plugin.

kkweon avatar kkweon commented on June 2, 2024

doesn't that mean no validation?

from semantic-release-replace-plugin.

kkweon avatar kkweon commented on June 2, 2024

After removing the config, I'm still getting the error.

image

[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.

kkweon avatar kkweon commented on June 2, 2024

Removing the "results" field completely was successful, now I guess there's no validation then.

from semantic-release-replace-plugin.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.