Skip to content

Commit edef4fa

Browse files
committed
feat: improve phar release script
1 parent 43eb0cb commit edef4fa

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

scripts/make-release.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,35 @@ set +e
99
rm -rf ./build
1010
mkdir ./build
1111

12-
VERSION=$(./bin/doctum.php --version | cut -d ' ' -f 2 | sed -e 's/^[[:space:]]*//')
12+
function get_version {
13+
VERSION=$($1 --version | cut -d ' ' -f 2 | sed -e 's/^[[:space:]]*//')
14+
}
15+
16+
get_version ./bin/doctum.php
1317
echo "${VERSION}" > ./build/VERSION
1418

1519
echo "Release for : ${VERSION}"
1620

1721
GPG_KEY=${GPG_KEY:-C4D91FDFCEF6B4A3C653FD7890A0EF1B8251A889}
1822

19-
composer update --no-dev
23+
echo "Remove dev-deps"
24+
composer update --no-dev --quiet
25+
echo "Generate phar"
2026
php -dphar.readonly=0 ./scripts/phar-generator-script.php
21-
composer update
27+
chmod +x ./build/doctum.phar
28+
echo "Update deps"
29+
composer update --quiet
30+
echo "Copy build files"
2231
cp CHANGELOG.md ./build/
2332
cp composer.lock ./build/
2433
sha256sum ./build/doctum.phar > ./build/doctum.phar.sha256
2534
sha256sum ./build/* > ./build/files.sha256
2635
gpg --detach-sig --local-user "${GPG_KEY}" --armor ./build/doctum.phar
2736
gpg --detach-sig --local-user "${GPG_KEY}" --armor ./build/doctum.phar.sha256
2837
gpg --detach-sig --local-user "${GPG_KEY}" --armor ./build/files.sha256
38+
echo "Lint"
39+
php -l ./build/doctum.phar
40+
echo "Version before build: ${VERSION}"
41+
get_version "php ./build/doctum.phar"
42+
echo "Version after build: ${VERSION}"
43+
echo "Done."

0 commit comments

Comments
 (0)