gh-semver

command module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

gh-semver

This GitHub CLI extension can be used determine the semantic version to release.

First it will search all tags and traverse up and down the git log to find the latest tag and inspect all commits made since against the conventional commits standard v1.0.0.

Prerequisites

Usage (commandline)

Install the extension by running:

gh extension install koozz/gh-semver

Run this extension with its keyword (default is semver):

gh semver

View more options with:

gh semver -help

In case of a newer version, upgrade by running:

gh extension upgrade koozz/gh-semver

Usage (GitHub Actions)

This extension can be used in a GitHub Actions workflow to determine the next semantic version.

In your workflow;

  • make sure the checkout has fetch-depth: 0
  • install the extension
  • call the extension
  • use the version as you see fit
# ...

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: SemVer
        id: semver
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh extension install koozz/gh-semver
          gh semver -action
      - name: Tag
        run: |
          git tag ${{ steps.semver.outputs.version }}

# ...

Or let the extension create the tag:

# ...

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: SemVer
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh extension install koozz/gh-semver
          gh semver -tag
          git push --tags

# ...

Example can be found in .github/workflows/auto-tag-main.yml

Roadmap

Things on the roadmap:

  • Semantic Versioning(-ish) for modules in a mono-repo;
    • Limit versioning to a directory within the repository.
    • Prefix the version with a module name.
  • Tests to make the software more robust and reliable.

Issues?

Help me out and describe the issue as complete a possible.

License

Apache 2.0

Documentation

Overview

Copyright 2022 Jan van den Berg

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL