Code Monkey home page Code Monkey logo

tagize's Introduction

tagize

CI workflow

This is a GitHub Action to automatically add/adjust Git tag aliases based on a semantic versioning schema.

Docker Image Dependecies

  • Bash: > 4.0
  • Git: > 2.0
  • OpenSSH: > 7.0

Setup

  • Give the GitHub Actions the write permission to the repo using this tutorial;
  • Add/merge following YAML to your workflow:
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
  # Triggers on (pre-)release
  release:
    types: [published]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v3

      # Execute 'tagize' action
      - uses: langroodi/tagize@v1

tagize's People

Contributors

langroodi avatar

Stargazers

 avatar

Watchers

 avatar

tagize's Issues

Latest tag detected incorrectly for double digit patch version

When running the action after creating a "v1.0.10" tag (where v1.0.1 -> v1.0.9 also exist already), the latest tag gets detected incorrectly as v1.0.9. I believe this is due to how the tags are sorted in this line:

Using sort -rV instead of sort -r could solve this:

  -V, --version-sort          natural sort of (version) numbers within text

For the repository I ran into this issue in, sorting without -V results in:

git tag -l 'v1.*' | cut -d"v" -f2 | sort -r
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.10
1.0.1
1.0.0
1.0

Whereas sorting with -V results in:

git tag -l 'v1.*' | cut -d"v" -f2 | sort -rV
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
1.0

Which would result in v1.0.10 being correctly detected as the latest tag.

I imagine a similar problem could also occur for double digit major and minor versions however I have not tested this.

In case more context helps, this is the worklow that was used:

name: Update Release Tag Aliases

# Run this workflow for the tag created when a GitHub release is published.
on:
  release:
    types: [published]

jobs:
  release:
    name: Update Release Tag Aliases
    runs-on: [self-hosted, Linux, X64, docker]
    steps:
      - name: Checkout Code
        uses: actions/checkout@v3

      # This will create and/or update semantically versioned tag aliases,
      # e.g. v1 for the latest 1.x.x and v1.2 for the latest 1.2.x etc.
      - name: Update Release Tag Aliases
        uses: langroodi/tagize@d5475d273560a7ee63ea3b41b824b6bb72a44bcd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.