Skip to content

Commit

Permalink
feat!: release v1 (#11)
Browse files Browse the repository at this point in the history
* feat: remove prefix input (#8)

* feat: remove prefix input

Fixes #1

* update build

* docs: update documentation (#10)

* ci: fix integration tests (#9)

* ci: fix integration tests

* remove old code

* docs: update docs for release
  • Loading branch information
jveldboom authored Feb 12, 2023
1 parent 9ca7365 commit 912fbb5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 27 deletions.
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ Design Descisions
# Default: minor
default-bump: ''

# Version prefix
# Default: v
prefix: ''

# Set the versioning mode to run (future use-case)
# Default: default
mode: ''
Expand All @@ -32,10 +28,10 @@ Design Descisions
## Outputs
| Name | Description |
|------|-------------|
`version` | full semantic version number without prefix (`1.2.3`)
`version-with-prefix` | version number with prefix (`v1.2.3`)
`version` | full semantic version number (`1.2.3`)
`version-with-prefix` | version number with `v` prefix (`v1.2.3`)
`major` | major version number
`major-with-prefix` | major version number with prefix (`v1`)
`major-with-prefix` | major version number with `v` prefix (`v1`)
`minor` | minor version number
`patch` | patch version number

Expand Down Expand Up @@ -80,10 +76,26 @@ jobs:
git push origin ${MAJOR}
```

## Contribute
I'll take all the help I can get so please feel free to contribute in anyway! Spelling & grammar errors, improve testing. Please check out the TODO list below for known items I'd like to resolve.

```shell
# install dependencies
yarn install
# unit Tests
yarn test:watch
# lint code via standardjs
yarn lint
```

## TODO
- [ ] Release v1 of action
- [x] Release v1 of action
- [x] Workflow to run regresssion tests with compiled action
- [ ] list action in marketplace
- [x] List action in marketplace
- [ ] Add version suffix that are semver
- [ ] Improve integration testing to cover all use-case. May require the ability to pass in a list of commits
- [ ] Improve index.js file
- Should it be simplified and wrapped in a try/catch?
- How can we get 100% test coverage on it?
Expand Down
8 changes: 2 additions & 6 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Conventional Versioning
description: GitHub Action that returns a sematic version based on Conventional Commits
branding:
icon: cloud
color: orange
icon: tag
color: blue

inputs:
github-token:
Expand All @@ -13,10 +13,6 @@ inputs:
description: Default version bump (major, minor, or patch)
required: false
default: patch
prefix:
description: Version prefix / string to prepend to version
required: false
default: v
mode:
description: Sets the version mode to run - future use-case
required: false
Expand Down
11 changes: 5 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44192,17 +44192,16 @@ const semver = __nccwpck_require__(1383)
const commit = __nccwpck_require__(156)

/**
* Output version spec
* Output version details
* @param {string} version version number
* @param {string} prefix version prefix
*/
const setVersionOutputs = (version, prefix) => {
const output = semver.parse(`${prefix}${version}`)
const setVersionOutputs = (version) => {
const output = semver.parse(version)

core.setOutput('version', output.version)
core.setOutput('version-with-prefix', `${prefix}${output.version}`)
core.setOutput('version-with-prefix', `v${output.version}`)
core.setOutput('major', output.major)
core.setOutput('major-with-prefix', `${prefix}${output.major}`)
core.setOutput('major-with-prefix', `v${output.major}`)
core.setOutput('minor', output.minor)
core.setOutput('patch', output.patch)
}
Expand Down
11 changes: 5 additions & 6 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ const semver = require('semver')
const commit = require('@semantic-release/commit-analyzer')

/**
* Output version spec
* Output version details
* @param {string} version version number
* @param {string} prefix version prefix
*/
const setVersionOutputs = (version, prefix) => {
const output = semver.parse(`${prefix}${version}`)
const setVersionOutputs = (version) => {
const output = semver.parse(version)

core.setOutput('version', output.version)
core.setOutput('version-with-prefix', `${prefix}${output.version}`)
core.setOutput('version-with-prefix', `v${output.version}`)
core.setOutput('major', output.major)
core.setOutput('major-with-prefix', `${prefix}${output.major}`)
core.setOutput('major-with-prefix', `v${output.major}`)
core.setOutput('minor', output.minor)
core.setOutput('patch', output.patch)
}
Expand Down

0 comments on commit 912fbb5

Please sign in to comment.