No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-03-23 06:11:32 -06:00
.github Deleted .github/workflows/rebase.yml 2025-03-23 06:11:32 -06:00
.gitignore Initial commit 2021-05-23 17:10:11 -04:00
.whitesource Added .whitesource 2021-07-02 12:52:34 -04:00
action.yml Update action.yml 2023-03-06 12:51:01 -07:00
CODE_OF_CONDUCT.md Added CODE_OF_CONDUCT.md 2021-07-02 16:43:52 -04:00
CONTRIBUTING.md Initial commit 2021-05-23 17:10:11 -04:00
entrypoint.sh fix: bug with empty output for initial releases 2024-03-01 19:58:47 -07:00
HISTORY.md Upgraded from v3.0.0 -> v3.0.1 2024-03-02 03:14:08 +00:00
LICENSE Initial commit 2021-05-23 17:10:11 -04:00
README.md Upgraded to v3 (#157) 2024-03-01 10:09:47 -07:00

CI Update release version. Public workflows that use this action.

semver-diff

Get the difference between two semantic versions using semver-tool

Example

Screen Shot 2021-05-24 at 7 13 32 AM

Usage

name: Get semver diff

on:
  release:
    types:
      - created
  push:
    tags:
      - v*

jobs:
  test:
    runs-on: ubuntu-latest
    name: semver-diff
    steps:
      - uses: actions/checkout@v3
      - name: Run semver-diff
        id: semver-diff
        uses: tj-actions/semver-diff@v3
      - name: Show release type
        run: |
          echo "Release type: ${{ steps.semver-diff.outputs.release_type }}"
        # Outputs: Release type: major || minor || patch || prerelease || build

Using bump2version

name: Upload Python Package

on:
  release:
    types: [created]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Run semver-diff
        id: semver-diff
        uses: tj-actions/semver-diff@v3

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.6.x'

      - name: Install dependencies
        ...

      - name: Setup git
        run: |
          git config --local user.email "github-actions[bot]@users.noreply.github.com"
          git config --local user.name "github-actions[bot]"

      - name: bumpversion
        run: |
          bump2version "${{ steps.semver-diff.outputs.release_type }}"
          git switch -c main 
       
      - name: Build and publish to PyPi
        ...
        
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v3
        with:
          base: "main"
          ...

Inputs

INPUT TYPE REQUIRED DEFAULT DESCRIPTION
initial_release_type string true "patch" Initial release type returned when
there are no existing tags.

Outputs

OUTPUT TYPE DESCRIPTION
new_version string The current project version
old_version string The previous project version
release_type string The difference between two versions
by the release type (major, minor, patch, prerelease, build)

If you feel generous and want to show some extra appreciation:

Buy me a coffee

Credits

This package was created with Cookiecutter using cookiecutter-action

Report Bugs

Report bugs at https://github.com/tj-actions/semver-diff/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your workflow that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.