Skip to content

Commit

Permalink
Modified tag names to differentiate between cli and dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Ncoder2 committed Jun 16, 2024
1 parent b5630d6 commit 3973707
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
23 changes: 14 additions & 9 deletions .github/actions/bump-version-and-git-tag/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@ runs:
- name: Bump poetry version
shell: bash
run: |
# Create Latest Image Version
poetry version "${{ inputs.releaseType }}"
new_version=$(poetry version --short)
echo "NEW_VERSION=$new_version" >> $GITHUB_ENV
latest_image_version=$(poetry version --short)
echo "LATEST_IMAGE_VERSION=$latest_image_version" >> $GITHUB_ENV
# Create git Tag version for cli
tag_version="cli-${latest_image_version}"
echo "TAG_VERSION=$tag_version" >> $GITHUB_ENV
# Add commit messsage for message bump
git add .
git commit -m "Bump poetry version to $new_version"
git commit -m "Bump poetry version to $latest_image_version"
# Check if the new version tag already exists
if git rev-parse "$new_version" >/dev/null 2>&1; then
echo "Tag $new_version already exists."
if git rev-parse "$tag_version" >/dev/null 2>&1; then
echo "Tag $tag_version already exists."
else
# Commit and tag the new version
echo "Tag $new_version does not exist."
git tag -a $new_version -m "$new_version"
git show "$new_version"
fi
echo "Tag $tag_version does not exist."
git tag -a $tag_version -m "$tag_version"
git show "$tag_version"
fi
8 changes: 4 additions & 4 deletions .github/workflows/mantis-cli-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
IMAGE_NAME: phonepe/mantis
jobs:
build-and-push-image:
if: github.event_name == 'workflow_dispatch'
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -42,10 +42,10 @@ jobs:
with:
releaseType: ${{ inputs.releaseType }}

- name: Push version bump commit
- name: Push tag changes
run: |
git push -u origin main
git push origin ${{ env.NEW_VERSION }}
git push origin ${{ env.TAG_VERSION }}
git log -1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -69,6 +69,6 @@ jobs:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NEW_VERSION }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.LATEST_IMAGE_VERSION }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mantis"
version = "1.0.0"
version = "0.1.0"
description = "Mantis is a security framework that automates the workflow of discovery, reconnaissance, and vulnerability scanning."
authors = ["Prateek Thakare <[email protected]>",
"Bharath Kumar <[email protected]>",
Expand Down

0 comments on commit 3973707

Please sign in to comment.