diff --git a/.github/actions/latex/entrypoint.sh b/.github/actions/latex/entrypoint.sh index aebcfae..7d32a23 100644 --- a/.github/actions/latex/entrypoint.sh +++ b/.github/actions/latex/entrypoint.sh @@ -21,10 +21,11 @@ res=`curl -H "Authorization: token $GITHUB_TOKEN" -X POST https://api.github.com \"prerelease\": false }"` -# extract release id -rel_id=`echo ${res} | python3 -c 'import json,sys;print(json.load(sys.stdin)["id"])'` +release_id=$(echo $res | jq '.id') +file_path="./main.pdf" -# upload built pdf -curl -H "Authorization: token $GITHUB_TOKEN" -X POST https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/${rel_id}/assets?name=main.pdf\ - --header 'Content-Type: application/pdf'\ - --upload-file main.pdf \ No newline at end of file +ls -la + +response=$(curl -X POST -H "Content-Type: $(file -b --mime-type $file_path)"\ + -H "Authorization: token $GITHUB_TOKEN" --data-binary @$file_path \ +"https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$release_id/assets?name=$(basename $file_path)")