File tree Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,18 @@ jobs:
19
19
- name : Clean up old distribution
20
20
run : bash clean_package.sh
21
21
22
+ - name : Determine Package Version
23
+ id : get_version
24
+ run : echo "PKG_VERSION=$(bash get_version.sh)" >> $GITHUB_ENV
25
+
22
26
- name : Build distribution
23
27
run : bash build_package.sh
24
28
25
29
- name : Create GitHub Release
26
30
uses : softprops/action-gh-release@v1
27
31
with :
28
32
files : dist/*
29
- name : Release ${{ github.ref_name }} of ${{ github.repository }}
30
- body : This is the release of ${{ github.repository }} for version ${{ github.ref_name }}
33
+ name : Release ${{ env.PKG_VERSION }} of ${{ github.repository }}
34
+ body : This is the release of ${{ github.repository }} for version ${{ env.PKG_VERSION }}
31
35
env :
32
36
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ python -m pip install --upgrade pip setuptools wheel
7
7
echo " Cleaning up previous builds..."
8
8
rm -rf build/ dist/ * .egg-info
9
9
10
- echo " Building the package..."
10
+ echo " Determining package version..."
11
+ # Use get_version.sh to determine the package version
12
+ PKG_VERSION=$( ./get_version.sh)
13
+ export PKG_VERSION
14
+
15
+ echo " Building the package with version $PKG_VERSION ..."
11
16
python setup.py sdist bdist_wheel
12
17
13
18
echo " Build output:"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # This script determines the current package version based on Git tags and commits.
3
+
4
+ set -e # Exit immediately in case of error, do not ignore errors
5
+
6
+ # Determine the package version from Git
7
+ current_commit=$( git rev-parse HEAD)
8
+ latest_tag_commit=$( git rev-list -n 1 --tags --abbrev=0)
9
+
10
+ if [ " $current_commit " == " $latest_tag_commit " ]; then
11
+ PKG_VERSION=$( git describe --tags --abbrev=0)
12
+ else
13
+ commit_hash=$( git rev-parse --short HEAD)
14
+ date=$( date +%Y%m%d)
15
+ PKG_VERSION=" 0.0.1.dev${date} +${commit_hash} "
16
+ fi
17
+
18
+ echo $PKG_VERSION
Original file line number Diff line number Diff line change
1
+ import os
1
2
from setuptools import setup , find_packages
2
3
3
4
with open ('README.md' , 'r' , encoding = 'utf-8' ) as fh :
4
5
long_description = fh .read ()
5
6
6
7
setup (
7
8
name = "ps_fuzz" ,
8
- version = "1. 0.0" ,
9
+ version = os . getenv ( 'PKG_VERSION' , ' 0.0.1' ) ,
9
10
author = "Prompt Security" ,
10
11
11
12
description = "LLM and System Prompt vulnerability scanner tool" ,
You can’t perform that action at this time.
0 commit comments