Code Monkey home page Code Monkey logo

Comments (10)

TriPSs avatar TriPSs commented on June 15, 2024 1

@jcornaz the json file is used to know what the latest version was and what the next version will be, so doing echo "{ \"version\": \"0.0.0\" }" > package.json will result in creating the same version again and again.

To solve that we can add logic to do it based on the latest tag.

I added this to the V3 milestone, tasks for this issue is:

  • Change package-json to version-file
  • Based on file extension determine on how to bump (JSON, Toml, Yaml)
  • Add version-path so users can define which value to update
  • Add skip-file to not update any file and use GIT tags for versioning
  • Add skip-tag to not create a tag and use file for versioning

from conventional-changelog-action.

TriPSs avatar TriPSs commented on June 15, 2024 1

This is released in v3

from conventional-changelog-action.

TriPSs avatar TriPSs commented on June 15, 2024

Hi,

Technically speaking you should be able use any json file that looks like this:

{
  "version": "1.0.0"
}

You could try the action like this:

- name: Conventional Changelog Action
  uses: TriPSs/conventional-changelog-action@v2
  with:
    github-token: ${{ secrets.github_token }}
    package-json: './custom.json'

from conventional-changelog-action.

jcornaz avatar jcornaz commented on June 15, 2024

Thanks for the quick answer!

Technically speaking you should be able use any json file that looks like this:

Well the tools I use don't rely on Json at all.

With gradle, my projects don't even have the version written anywhere. They rely solely on tags. (thanks to reckon)

And with cargo the version is written in a toml file like this:

[package]
version = "1.0.0"

Of course there are plenty of other build tools out there, each of them having different ways of doing things.

So I presume the answer is "no" I cannot use it for non-javascript projects?

Based on that, I would like to reformulate my question into a feature request: "Make package.json optional"

from conventional-changelog-action.

TriPSs avatar TriPSs commented on June 15, 2024

Okay thanks for the explanation, so for Gradle it would be possible to just create a json file like described above?

For cargo we can look into supporting the toml format, we could change package-json argument to version-file that will look into the file extension and based on that bumps the version in it accordingly.

from conventional-changelog-action.

TriPSs avatar TriPSs commented on June 15, 2024

Maybe also a nice addition would be the ability to define the path of the version, for example inside a json file the default will be version and the default for toml will be package.version, this way if the location of the version is on a different location you get the ability to change it.

from conventional-changelog-action.

jcornaz avatar jcornaz commented on June 15, 2024

so for Gradle it would be possible to just create a json file like described above?

Of course I could always add an echo "{ \"version\": \"0.0.0\" }" > package.json step in my CI and delete after invoking conventional-changelog-action. But I'd prefer to be able to configure the action with something like:

- uses: TriPSs/conventional-changelog-action@v2
   with:
     github-token: ${{ secrets.github_token }}
     package-json: 'false'

For cargo we can look into supporting the toml format

That would be awesome!

from conventional-changelog-action.

bmahlbrand avatar bmahlbrand commented on June 15, 2024

I made a version.yaml file based the test file found in the root of the repo, can anyone elaborate on the expected format for yaml? When I use the below file, the following error occurs:

image

package:
  version: '0.0.1'

from conventional-changelog-action.

TriPSs avatar TriPSs commented on June 15, 2024

Hi @bmahlbrand, the default would be:

version: '0.0.1'

If you would like to follow the format you have than you can add the following to the action

with:
   version-path: 'package.version'

from conventional-changelog-action.

bmahlbrand avatar bmahlbrand commented on June 15, 2024

Works great! Thanks for the quick answer!

from conventional-changelog-action.

Related Issues (20)

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.