diff --git a/lib b/lib index ab91af8..94275e8 100644 --- a/lib +++ b/lib @@ -7,9 +7,15 @@ function create-archive(){ zip -r -9 ./release/module.zip ./src/* } +function create-varfile(){ + RELEASE_TAG=$(echo $DRONE_COMMIT_MESSAGE | tr -d '\n')-$DRONE_BRANCH + COMMIT_SHA=$(git rev-parse HEAD) + echo $RELEASE_TAG >> vars + echo $COMMIT_SHA >> vars +} + function set-variables(){ - export RELEASE=$(echo $DRONE_COMMIT_MESSAGE | tr -d '\n')-$DRONE_BRANCH - echo "$RELEASE" + source ./vars envsubst < module.json.template > ./module.json cat ./module.json } @@ -21,7 +27,7 @@ function create-commit(){ } function create-release(){ - COMMIT_SHA=$(git rev-parse HEAD) + source ./vars RESPONSE=$(curl \ -X 'POST' \ -Url "https://gitea.kdiva.ru/api/v1/repos/${DRONE_REPO}/releases" \