Skip to content

Commit

Permalink
Add SHA as custom ENV variable to the .dep package
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlikho committed Jul 8, 2024
1 parent 1685f3f commit 569c09c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,16 @@ jobs:
echo "EOF" >> ${GITHUB_ENV}
echo Release package version $VERSION
if [ -f $directory/src/deb/build-deb.sh ]; then
cd $directory && source ./src/deb/build-deb.sh
Add cd $directory
# change the DEB SHA ENV value in default-env file & make backup
sed -i.bak 's/SHA=.*/SHA='${{ github.sha }}'/g' ./src/deb/templates/default-env
source ./src/deb/build-deb.sh
PACKAGE_NAME=./target/${SERVICE_NAME}-${VERSION}.deb
echo push to Google Artifactory Debian Registry $DEB_REGISTRY
gcloud artifacts apt upload $DEB_REGISTRY --location=$REGISTRY_LOCATION --source=$PACKAGE_NAME
# revert changes of the DEB SHA ENV value & remove backup file
rm ./src/deb/templates/default-env
mv ./src/deb/templates/default-env.bak ./src/deb/templates/default-env
cd ..
else
echo "The file $directory/src/deb/build-deb.sh does not exist in $directory. Skip it."
Expand Down

0 comments on commit 569c09c

Please sign in to comment.