mirror of
https://github.com/danog/MadelineProto.git
synced 2024-12-12 11:07:40 +01:00
43 lines
872 B
Bash
43 lines
872 B
Bash
|
#!/bin/bash -e
|
||
|
|
||
|
# 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"
|
||
|
|
||
|
# Clean up
|
||
|
madelinePath=$PWD
|
||
|
|
||
|
if [ "$SSH_KEY" != "" ]; then
|
||
|
eval "$(ssh-agent -s)"
|
||
|
echo -e "$SSH_KEY" > madeline_rsa
|
||
|
chmod 600 madeline_rsa
|
||
|
ssh-add madeline_rsa
|
||
|
fi
|
||
|
|
||
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||
|
git config --global user.name "Github Actions"
|
||
|
|
||
|
input=$PWD
|
||
|
|
||
|
cd ~/MadelineProtoPhar
|
||
|
git pull
|
||
|
|
||
|
cp "$input/tools/phar.php" .
|
||
|
for php in 71 72 73 74 80 81; do
|
||
|
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
|