1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-12-13 15:47:20 +01:00
MadelineProto/tests/deploy.sh

46 lines
1.0 KiB
Bash
Raw Normal View History

2022-05-01 19:13:36 +02:00
#!/bin/bash -e
2022-06-04 21:23:34 +02:00
echo "$TAG" | grep -q '\.9999' && exit 0 || true
echo "$TAG" | grep -q '\.9998' && exit 0 || true
2022-05-01 19:13:36 +02:00
# Configure
COMMIT="$(git log -1 --pretty=%H)"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
COMMIT_MESSAGE="$(git log -1 --pretty=%B HEAD)"
echo "Branch: $BRANCH"
echo "Commit: $COMMIT"
echo "Latest tag: $TAG"
2023-01-15 22:13:21 +01:00
gh release edit --prerelease=false "$TAG"
2022-05-01 19:13:36 +02:00
2022-06-04 17:40:03 +02:00
if [ "$DEPLOY_KEY" != "" ]; then
2022-06-06 23:20:01 +02:00
mkdir -p $HOME/.ssh
ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
echo "$DEPLOY_KEY" > $HOME/.ssh/id_rsa
chmod 0600 $HOME/.ssh/id_rsa
2022-05-01 19:13:36 +02:00
fi
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "Github Actions"
input=$PWD
2022-06-04 17:40:03 +02:00
cd /tmp
git clone git@github.com:danog/MadelineProtoPhar.git
cd MadelineProtoPhar
2022-05-01 19:13:36 +02:00
cp "$input/tools/phar.php" .
2023-01-20 20:13:48 +01:00
for php in 81; do
2022-05-01 19:13:36 +02:00
echo -n "$COMMIT-$php" > release$php
done
git add -A
git commit -am "Release $BRANCH - $COMMIT_MESSAGE"
while :; do
git push origin master && break || {
git fetch
git rebase origin/master
}
done