Skip to content

Commit

Permalink
Fix appstore URL
Browse files Browse the repository at this point in the history
  • Loading branch information
R0Wi committed Oct 12, 2020
1 parent c5042f3 commit a011fe6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ runs:
APPSTORE_TOKEN: ${{ inputs.appstore_token }}
APPSTORE_USERNAME: ${{ inputs.appstore_username }}
APPSTORE_PASSWORD: ${{ inputs.appstore_password }}
APPSTORE_URL: "https://apps.nextcloud.com/api/v1/apps/releases"
NIGHTLY: ${{ inputs.nightly }}
DOWNLOAD_URL: ${{ inputs.download_url }}
APP_PRIVATE_KEY_FILE: ${{ github.workspace }}/${{ inputs.app_name }}.key
Expand Down
6 changes: 3 additions & 3 deletions push_appstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ set -eo pipefail
# APPSTORE_TOKEN
# APPSTORE_USERNAME
# APPSTORE_PASSWORD
# APPSTORE_URL
# NIGHTLY
# DOWNLOAD_URL
# APP_PRIVATE_KEY_FILE

script_dir="$(dirname "$0")"
appstore_url=$APPSTORE_URL || "https://apps.nextcloud.com/api/v1/apps/releases"

. "${script_dir}/functions.sh"

Expand All @@ -26,11 +26,11 @@ echo "Creating new app release in Nextcloud appstore (nightly=${NIGHTLY})"
if [ ! -z $APPSTORE_TOKEN ]
then
echo "Using token authentication"
curl -s --fail --show-error -X POST $appstore_url -H "Authorization: Token ${APPSTORE_TOKEN}" -H "Content-Type: application/json" -d "{\"download\": \"${DOWNLOAD_URL}\", \"signature\": \"${sign}\", \"nightly\": ${NIGHTLY} }"
curl -s --fail --show-error -X POST $APPSTORE_URL -H "Authorization: Token ${APPSTORE_TOKEN}" -H "Content-Type: application/json" -d "{\"download\": \"${DOWNLOAD_URL}\", \"signature\": \"${sign}\", \"nightly\": ${NIGHTLY} }"
elif [ ! -z $APPSTORE_USERNAME ] && [ ! -z $APPSTORE_PASSWORD ]
then
echo "Using username password authentication"
curl -s --fail --show-error -X POST $appstore_url -u "${APPSTORE_USERNAME}:${APPSTORE_PASSWORD}" -H "Content-Type: application/json" -d "{\"download\": \"${DOWNLOAD_URL}\", \"signature\": \"${sign}\", \"nightly\": ${NIGHTLY} }"
curl -s --fail --show-error -X POST $APPSTORE_URL -u "${APPSTORE_USERNAME}:${APPSTORE_PASSWORD}" -H "Content-Type: application/json" -d "{\"download\": \"${DOWNLOAD_URL}\", \"signature\": \"${sign}\", \"nightly\": ${NIGHTLY} }"
else
echo "Authentication cannot be done. Please provide 'appstore_token' or 'appstore_username' and 'appstore_password' input variables."
exit 1
Expand Down

0 comments on commit a011fe6

Please sign in to comment.