upload bin instead of elf

This commit is contained in:
Jonas Leder 2022-12-30 14:57:23 +01:00
commit f119f58f40

View file

@ -27,4 +27,37 @@ steps:
commands:
- source .env
- apk add --no-cache curl
- curl --user "jonasled:$DOCKER_PASSWORD" --upload-file ".pio/build/d1_mini_lite/firmware.elf" "https://$gitea_domain/api/packages/$gitea_user/generic/$gitea_repo/$DRONE_BRANCH/firmware.elf"
- package_link="https://$gitea_domain/api/packages/$gitea_user/generic/$gitea_repo/$DRONE_BRANCH/firmware.bin"
- |
if ! curl -s --head --user "$gitea_user:$DOCKER_PASSWORD" --request GET "$package_link" | grep "404 Not Found" > /dev/null
then
echo "File already exists, deleting it"
curl --user "$gitea_user:$DOCKER_PASSWORD" -X DELETE "$package_link"
fi
- curl --user "$gitea_user:$DOCKER_PASSWORD" --upload-file ".pio/build/d1_mini_lite/firmware.bin" $package_link
when:
event:
- push
- name: upload-to-transfersh
image: archlinux
commands:
- pacman -Syu --noconfirm curl
- download_url=$(curl --upload-file "f.pio/build/d1_mini_lite/firmware.bin" "https://transfer.jonasled.de")
- echo "download_url=$download_url" >> .env
- 'echo "Download URL: $download_url" > comment.txt'
when:
event:
- pull_request
- name: add comment to gitea pull request
image: tsakidev/giteacomment:latest
settings:
gitea_token:
from_secret: gitea_token
gitea_base_url: https://jonasled.dev
comment_title: 'Build finished'
comment_from_file: comment.txt
when:
event:
- pull_request