2022-05-01 19:13:36 +02:00
|
|
|
#!/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"
|
|
|
|
|
2022-05-03 01:25:01 +02: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-05-01 19:13:36 +02:00
|
|
|
eval "$(ssh-agent -s)"
|
2022-06-04 17:40:03 +02:00
|
|
|
echo -e "$DEPLOY_KEY" > madeline_rsa
|
2022-05-01 19:13:36 +02:00
|
|
|
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
|
|
|
|
|
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" .
|
|
|
|
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
|