Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sync with changes from main of common-lib #39

Merged
merged 11 commits into from
Sep 24, 2024
13 changes: 13 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
titleOnly: true

types:
- fix
- feat
- feature
- fixes
- chore
- perf
- docs
- doc
- release
- misc
52 changes: 52 additions & 0 deletions .github/workflows/tag-patch-incre.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Increment tag for patch or minor

on:
pull_request:
branches:
- main
types:
- closed # Trigger only when a PR is closed (merged or not)

jobs:
tag:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create new tag
env:
TOKEN: ${{ secrets.TAG_CREATION_TOKEN_PUBLIC }}
run: |
echo $TOKEN | gh auth login --with-token
latest_tag=$(git tag | sort -V | tail -n 1)
echo "Latest tag: $latest_tag"

# Extract major and minor versions
version=$(echo $latest_tag | cut -d. -f1-2)
# Extract patch version
patch=$(echo $latest_tag | cut -d. -f3)
# Extract minor version
minor=$(echo $latest_tag | cut -d. -f2)
major=$(echo $latest_tag | cut -d. -f1)

# Check if the incoming branch starts with 'release-candidate-'
incoming_branch="${{ github.head_ref }}"
if [[ "$incoming_branch" == release-candidate-* ]]; then
# Increment minor version and reset patch
new_minor=$((minor+1))
new_tag="$major.$new_minor.0"
echo "New tag will be (minor increment): $new_tag"
else
# Increment patch version
new_tag="$version.$((patch+1))"
echo "New tag will be (patch increment): $new_tag"
fi

git config --global user.email "devops@devtron.ai"
git config --global user.name "systemsdt"
git tag $new_tag
git push origin $new_tag
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ require (
)

require (
github.com/devtron-labs/common-lib v0.16.1-0.20240909135009-9ab705e1a141
github.com/devtron-labs/common-lib v0.16.1-0.20240911071031-2625327bc7b4
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.18.1 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWH
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/devtron-labs/common-lib v0.16.1-0.20240909135009-9ab705e1a141 h1:Fj4FhBUEu6igP8jmipcSC2CG0iudRhbviNSeg02kEvk=
github.com/devtron-labs/common-lib v0.16.1-0.20240909135009-9ab705e1a141/go.mod h1:rAY9Xd6iz+OqNQ3nO3reVHapAVr1N6Osf4Irdc0A08Q=
github.com/devtron-labs/common-lib v0.16.1-0.20240911071031-2625327bc7b4 h1:OWhV5B2SQRWZges8cltVsyUrdA/8EByBjjRxX95qN7o=
github.com/devtron-labs/common-lib v0.16.1-0.20240911071031-2625327bc7b4/go.mod h1:rAY9Xd6iz+OqNQ3nO3reVHapAVr1N6Osf4Irdc0A08Q=
github.com/devtron-labs/protos v0.0.3-0.20240130061723-7b2e12ab0abb h1:CkfQQgZc950/hTPqtQSiHV2RmZgkBLGCzwR02FZYjAU=
github.com/devtron-labs/protos v0.0.3-0.20240130061723-7b2e12ab0abb/go.mod h1:pjLjgoa1GzbkOkvbMyP4SAKsaiK7eG6GoQCNauG03JA=
github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY=
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ github.com/caarlos0/env
# github.com/cespare/xxhash/v2 v2.2.0
## explicit; go 1.11
github.com/cespare/xxhash/v2
# github.com/devtron-labs/common-lib v0.16.1-0.20240909135009-9ab705e1a141
# github.com/devtron-labs/common-lib v0.16.1-0.20240911071031-2625327bc7b4
## explicit; go 1.21
github.com/devtron-labs/common-lib/constants
github.com/devtron-labs/common-lib/git-manager/util
Expand Down
Loading