Skip to content

Repository files navigation

About:

This action is used for determining the next version of VisualPinball.* projects.

It should only be used by VisualPinball.* projects in workflows and should not be deployed to the marketplace.

VisualPinball.* projects use the following versioning:

package.jsonlatest repo tagnew tag/publish versionnotes
10.0.1-preview.0n/a0.0.1-preview.0first release
20.0.1-preview.00.0.1-preview.00.0.1-preview.1auto-incr
30.0.1-preview.00.0.1-preview.10.0.1-preview.2auto-incr
40.0.1-preview.00.0.1-preview.20.0.1.preview.3auto-incr
50.0.10.0.1-preview.30.0.1manual bump
60.1.0-preview.00.0.10.1.0-preview.0reset, since no previous 0.1.0-preview found
70.2.00.1.0-preview.00.2.0we noticed that we actually want to bump minor, not just patch
60.2.1-preview.00.2.00.2.1-preview.0business as usual

This action was inspired by latest-tag and was derived from this template.

Usage:

You should use this action in a workflow immediately after checkout. The following outputs will be set:

  • version - version in package.json
  • tags - git tags in semver format
  • nextVersion - computed next version (see table above)
  • nextTag - computed next version, prefixed (see below)
  • isBump - true if computed next version differs from version in package.json, false otherwise
  • isPrerelease - true if pre-release, false otherwise

For inputs, the following options are available:

  • path - path to folder containing package.json (leave blank for root folder).
  • tagPrefix - adds a string to the nextTag (default: '').

Example yml:

- uses: actions/checkout@v2with:
fetch-depth: 0
- name: Fetch next versionid: nextVersionuses: VisualPinball/next-version-action@v0.1.7with:
tagPrefix: 'v'
- name: Log next version outputsrun: | echo "${{ steps.nextVersion.outputs.version }}" echo "${{ steps.nextVersion.outputs.nextVersion }}" echo "${{ steps.nextVersion.outputs.nextTag }}" echo "${{ steps.nextVersion.outputs.isBump }}" echo "${{ steps.nextVersion.outputs.isPrerelease }}"

Note: For this action to work properly, make sure to configure actions/checkout@v2 with a fetch-depth: 0.

Development:

Install the dependencies

$ npm install

Build the typescript and package it for distribution

$ npm run build && npm run package

Run the tests

$ npm test
PASS __tests__/main.test.ts
√ should use version from package.json if no tag is available (2ms)
√ should bump version if same tag is available
√ should bump version if same tag is available but prefixed
√ should bump version if same tag is available but not prefixed (1ms)
√ should use bump latest pre-release tag if multiple tags are available
√ should use bump latest tag if multiple tags are available sorted the other way around
√ should use bump latest tag if one tag was skipped (1ms)
√ should use major version from major package.json if no tag matched
√ should use pre-release version from pre-release package.json if no tag matched
√ should bump final version if tag already exists and ends with 0
√ should throw an error for wrong versions (2ms)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages