This repository has been archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into suan/update-java-buil…
…dpack Signed-off-by: Andrew Su <[email protected]>
- Loading branch information
Showing
33 changed files
with
13,729 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# SemVer Bump Action | ||
|
||
This action reads a file for the semver version and increment it based on the release type. | ||
|
||
## Inputs | ||
|
||
### `path` | ||
**Required** The path to the file containing the semantic version. | ||
|
||
### `release-type` | ||
**Required** The type of release. Acceptable values are: `major`, `minor`, `patch` | ||
|
||
### `pre-release` | ||
The pre-release label. This will still cause a bump to the appropriate semver component specified by `release-type`. | ||
|
||
## Outputs | ||
|
||
### `previous-version` | ||
This is the version stored in the file at time of execution. | ||
|
||
### `version` | ||
This is the version we are moving to. | ||
|
||
## Usage | ||
|
||
You can now consume the action by referencing the v1 branch | ||
|
||
```yaml | ||
uses: ./.github/actions/semver-bump | ||
with: | ||
path: ./path/to/VERSION | ||
release-type: patch | ||
pre-release: my-pre-release-label | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2021-2022 VMware, Inc. | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
|
||
name: 'Semver Bump' | ||
description: 'Bump the designated semver component in a file.' | ||
inputs: | ||
path: | ||
description: 'path to file containing semver to bump' | ||
required: true | ||
release-type: | ||
description: 'semver component [major, minor, patch] to modify' | ||
required: true | ||
pre-release: | ||
description: 'pre-release label' | ||
outputs: # output will be available to future steps | ||
previous-version: | ||
description: 'The previous version' | ||
version: | ||
description: 'The current version' | ||
runs: | ||
using: 'node12' | ||
main: 'dist/index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2021-2022 VMware, Inc. | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
*/ | ||
|
||
const semver = require("semver"); | ||
|
||
let isValidSemver = function (version) { | ||
return new Promise((resolve)=>{ | ||
resolve(semver.valid(version) !== null) | ||
}) | ||
} | ||
|
||
let incMajor = function (version, preReleaseLabel) { | ||
return new Promise((resolve) => { | ||
let type = 'major' | ||
if (preReleaseLabel) { | ||
type = 'premajor' | ||
} | ||
resolve(semver.inc(version, type, preReleaseLabel)) | ||
}) | ||
} | ||
|
||
let incMinor = function (version, preReleaseLabel) { | ||
return new Promise((resolve) => { | ||
let type = 'minor' | ||
if (preReleaseLabel) { | ||
type = 'preminor' | ||
} | ||
resolve(semver.inc(version, type, preReleaseLabel)) | ||
}) | ||
} | ||
|
||
let incPatch = function (version, preReleaseLabel) { | ||
return new Promise((resolve) => { | ||
let type = 'patch' | ||
if (preReleaseLabel) { | ||
type = 'prepatch' | ||
} | ||
resolve(semver.inc(version, type, preReleaseLabel)) | ||
}) | ||
} | ||
|
||
|
||
module.exports = {incMajor, incMinor, incPatch, isValidSemver}; |
Oops, something went wrong.