iPhone 8 15 LYRASIS #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: iPhone 8 15 LYRASIS | |
on: | |
schedule: | |
- cron: '30 8 * * 6' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Upload to browserstack and trigger tests | |
run: | | |
COMMITS=$(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/ThePalaceProject/ios-binaries/commits) | |
URLS=$(echo $COMMITS | jq -r '.[] | select(.commit.author.name=="runner")' | jq -r '.url') | |
URL=${URLS:0:107} | |
echo URL: $URL | |
RESPONSE=$(curl -H "Accept: application/vnd.github.v3+json" $URL) | |
readarray -t build_name <<<"$(jq '.files[].filename'<<<$RESPONSE)" | |
ZIP_NAME=${build_name:1:21} | |
unzip $ZIP_NAME | |
fileName=*.ipa | |
echo file: $fileName | |
BUILD_NAME=$fileName | |
echo buildName: $BUILD_NAME | |
fileName_abs_path=$(realpath $fileName) | |
APP_UPLOAD_RESPONSE=$(curl -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESSKEY }}" -X POST "https://api-cloud.browserstack.com/app-automate/upload" -F "file=@$fileName_abs_path") | |
APP_ID=$(echo $APP_UPLOAD_RESPONSE | jq -r ".app_url") | |
echo APP_ID: $APP_ID | |
echo "Triggering autotests" | |
curl -X POST -H "Accept:application/vnd.github.v3+json" https://api.github.com/repos/ThePalaceProject/mobile-integration-tests-new/actions/workflows/maven.yml/dispatches -d '{"ref":"main", "inputs":{"test_tag":"@tier1","build_name":"'"$BUILD_NAME"'","device_name_and_version":"iPhone8_15","bs_app_link":"'"$APP_ID"'","platform_name":"ios"}}' -H "Authorization: token ${{secrets.PERSONAL_TOKEN}}" |