Update build-ios-release-pullrequest.yml

This commit is contained in:
Marcos Rodriguez Velez 2024-03-01 20:16:58 -04:00
parent df4f93a554
commit bceec7ed17
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7

View File

@ -178,12 +178,10 @@ jobs:
if: success() # Ensures the message is only posted if previous steps succeed
env:
BUILD_NUMBER: ${{ needs.build.outputs.new_build_number }}
LATEST_COMMIT_MESSAGE: ${{ needs.build.outputs.latest_commit_message }}
with:
script: |
const buildNumber = process.env.BUILD_NUMBER;
const latestCommitMessage = process.env.LATEST_COMMIT_MESSAGE;
const message = `The build ${buildNumber} has been uploaded to TestFlight. The most recent commit for this build is:\n\n '${latestCommitMessage}'`;
const message = `The build ${buildNumber} has been uploaded to TestFlight.`;
const prNumber = context.payload.pull_request.number;
const repo = context.repo;
github.rest.issues.createComment({
@ -191,3 +189,50 @@ jobs:
issue_number: prNumber,
body: message,
});
upload-to-browserstack:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Download IPA from Artifact
uses: actions/download-artifact@v2
with:
name: BlueWallet.${{needs.build.outputs.project_version}}(${{needs.build.outputs.new_build_number}}).ipa
path: ./build
- name: Upload IPA to BrowserStack
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
run: |
curl -u "$BROWSERSTACK_USERNAME:$BROWSERSTACK_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "file=@./ios/build/BlueWallet.${{env.PROJECT_VERSION}}(${{ env.NEW_BUILD_NUMBER }}).ipa" \
-o browserstack_response.json
- name: Extract BrowserStack App URL
id: extract_url
run: |
APP_URL=$(jq -r '.app_url' browserstack_response.json)
echo "APP_URL=$APP_URL"
echo "::set-output name=app_url::$APP_URL"
- name: Post comment with BrowserStack link
uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const prNumber = context.issue.number;
const browserStackLink = '${{ steps.extract_url.outputs.app_url }}'; // Use the output from the previous step.
const message = `🚀 App is now available for testing on BrowserStack: [Test Here](${browserStackLink})`;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: message
});