-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (29 loc) · 1.62 KB
/
iPhone8_15_Lyrasis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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}}"