@@ -13,6 +13,12 @@ inputs:
1313 description : ' Is cross platform build?'
1414 required : false
1515 default : ' false'
16+ pre-build-command :
17+ description : ' Command to execute before packaging'
18+ required : false
19+ post-build-command :
20+ description : ' Command to execute after packaging'
21+ required : false
1622
1723 python-version :
1824 description : ' Python version'
@@ -73,18 +79,26 @@ runs:
7379 echo "Error: Invalid version"
7480 exit 1
7581 fi
82+ echo "GIT_TAG=v$VERSION" >> $GITHUB_ENV
7683 - name : Update version in setup.py
7784 shell : bash
7885 run : sed -i "s/version='.*',/version='$VERSION',/" setup.py
7986 - if : ${{ inputs.debian-dist-type == 'application' }}
80- name : Update version in debian/changelog
87+ name : Check and update version in debian/changelog
8188 shell : bash
8289 run : |
83- sudo apt-get update
84- sudo apt-get install -y devscripts
85- export DEBEMAIL="action@github.com"
86- export DEBFULLNAME="GitHub Action"
87- dch -v $VERSION -D stable "Release $VERSION"
90+ if ! grep -q "($VERSION)" debian/changelog; then
91+ sudo apt-get update
92+ sudo apt-get install -y devscripts
93+ export DEBEMAIL="action@github.com"
94+ export DEBFULLNAME="GitHub Action"
95+ dch -v $VERSION -D stable "Release $VERSION"
96+ fi
97+
98+ - if : ${{ inputs.pre-build-command }}
99+ name : Run pre-build command
100+ shell : bash
101+ run : ${{ inputs.pre-build-command }}
88102
89103 - if : ${{ inputs.is-cross-platform != 'true' }}
90104 name : Build native or platform independent packages
@@ -106,6 +120,11 @@ runs:
106120 devcontainer-config : ${{ inputs.devcontainer-config }}
107121 devcontainer-command : ${{ inputs.devcontainer-command }}
108122
123+ - if : ${{ inputs.post-build-command }}
124+ name : Run post-build command
125+ shell : bash
126+ run : ${{ inputs.post-build-command }}
127+
109128 - name : Commit changes
110129 shell : bash
111130 run : |
0 commit comments