Skip to content

Commit

Permalink
feat(core): add --prerelease option to mark project as non-producti…
Browse files Browse the repository at this point in the history
…on ready
  • Loading branch information
dalisoft committed Feb 21, 2024
1 parent 6cf4fb7 commit 4fa23e2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,16 @@ bash .release-me/release.sh --plugins=git,github-release --preset=conventional-c

## Options

| Name | Description | Default | Required |
| ----------- | ---------------------------------------------------------- | ---------------------- | -------- |
| `dry-run` | Show only actions on logs | `false` | No |
| `verbose` | Verbose logs | `true` on CI | No |
| `quiet` | Quiet logs | `false` | No |
| `workspace` | Releases every projects on workspace | `false` | No |
| `stable` | If project current version is `0.x`, it will bump to `1.x` | `false` | No |
| `presets` | Presets compatibility, see [Presets](#presets) | `conventional-commits` | No |
| `plugins` | Plugins compatibility, see [Plugins](#plugins) | `git` | No |
| Name | Description | Default | Required |
| ------------ | ---------------------------------------------------------- | ---------------------- | -------- |
| `dry-run` | Show only actions on logs | `false` | No |
| `verbose` | Verbose logs | `true` on CI | No |
| `quiet` | Quiet logs | `false` | No |
| `workspace` | Releases every projects on workspace | `false` | No |
| `stable` | If project current version is `0.x`, it will bump to `1.x` | `false` | No |
| `prerelease` | Publish this project as non-production ready | `false` | No |
| `presets` | Presets compatibility, see [Presets](#presets) | `conventional-commits` | No |
| `plugins` | Plugins compatibility, see [Plugins](#plugins) | `git` | No |

## Environment variables

Expand Down
9 changes: 9 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ IS_DRY_RUN=false
IS_QUIET=false
IS_VERBOSE=false
IS_STABLE_VERSION=false
PRE_RELEASE_VERSION=false
PLUGINS=("git")
PRESET="conventional-commits"

Expand Down Expand Up @@ -104,6 +105,10 @@ function parseOptions {
# shellcheck disable=2034
IS_STABLE_VERSION=true
;;
--prerelease)
# shellcheck disable=2034
PRE_RELEASE_VERSION=true
;;
-d | --dry-run)
# shellcheck disable=2034
IS_DRY_RUN=true
Expand Down Expand Up @@ -239,6 +244,10 @@ function getGitVariables {
if [ -n "$GIT_LAST_PROJECT_TAG_VER" ]; then
mapfile -d '.' -t SEMANTIC_VERSION < <(printf '%s' "$GIT_LAST_PROJECT_TAG_VER")
SEMANTIC_VERSION_COPY=("${SEMANTIC_VERSION[@]}")

if [[ $IS_STABLE_VERSION == false && "${SEMANTIC_VERSION[0]}" -gt 0 ]]; then
IS_STABLE_VERSION=true
fi
fi
}

Expand Down

0 comments on commit 4fa23e2

Please sign in to comment.