Update .gitlab-ci.yml file

This commit is contained in:
jastornig 2023-12-31 18:37:48 +00:00
parent 953d2f2a56
commit b036fb51a1

View file

@ -85,11 +85,19 @@ release_job:
- name: APK - name: APK
url: '${CI_PROJECT_URL}/-/jobs/${BUILD_JOB_ID}/artifacts/file/${RELEASE_APK}' url: '${CI_PROJECT_URL}/-/jobs/${BUILD_JOB_ID}/artifacts/file/${RELEASE_APK}'
- name: Download APK - name: Download APK
url: 'https://www.dropbox.com/scl/fo/dy21dx1cr2y42jmjmpkg0/h?rlkey=bofaz20jaofeqhgptv023lawl&dl=0' url: $url
script: script:
- apk add curl jq - apk add curl jq
- content=$(curl https://api.dropbox.com/oauth2/token -d grant_type=refresh_token -d refresh_token=$REFRESH_TOKEN -d client_id=$CLIENT_KEY -d client_secret=$CLIENT_SECRET) - content=$(curl https://api.dropbox.com/oauth2/token -d grant_type=refresh_token -d refresh_token=$REFRESH_TOKEN -d client_id=$CLIENT_KEY -d client_secret=$CLIENT_SECRET)
- token=$(echo $content | jq -r ".access_token") - token=$(echo $content | jq -r ".access_token")
- echo 'Dropbox-API-Arg:' {\"path\"':' \"/release/v0_$CI_PIPELINE_IID/$RELEASE_APK\"} > arg.json - echo 'Dropbox-API-Arg:' {\"path\"':' \"/release/v0_$CI_PIPELINE_IID/$RELEASE_APK\"} > arg.json
- | - |
curl -X POST https://content.dropboxapi.com/2/files/upload --header "Authorization: Bearer $token" --header "Content-Type: application/octet-stream" --header @arg.json --data-binary @"$RELEASE_APK" curl -X POST https://content.dropboxapi.com/2/files/upload --header "Authorization: Bearer $token" --header "Content-Type: application/octet-stream" --header @arg.json --data-binary @"$RELEASE_APK"
- echo {\"path\":\"/release/v0_$CI_PIPELINE_IID/$RELEASE_APK\", "settings":{\"access\":\"viewer\", \"allow_download\":true}} >> data.json
- |
content=$(curl -X POST https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings --header "Authorization: Bearer $token" \
--header "Content-Type: application/json" \
--data @data.json)
url=$(echo $content | jq -r ".url")