From 6eb74e3fe339112018583eed5fe5f911fef19f2f Mon Sep 17 00:00:00 2001 From: Josh Leyshon Date: Fri, 24 May 2024 21:23:19 +0930 Subject: [PATCH 1/6] EAS Build workflow now builds the PR branch and displays a status on the PR Signed-off-by: Josh Leyshon --- .github/workflows/easBuild.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/easBuild.yml b/.github/workflows/easBuild.yml index 283f031..9df76ed 100644 --- a/.github/workflows/easBuild.yml +++ b/.github/workflows/easBuild.yml @@ -14,8 +14,21 @@ jobs: }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Get PR branch + uses: xt0rted/pull-request-comment-branch@v2 + id: pr-branch-info + + - name: Set commit status as pending + uses: myrotvorets/set-commit-status-action@v2.0.1 + with: + sha: ${{ steps.pr-branch-info.head_sha }} + status: pending + + - name: Checkout PR branch + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 with: node-version: 18.x cache: npm @@ -32,3 +45,10 @@ jobs: - name: 🏗 Build on EAS run: eas build --platform android --profile preview --non-interactive + + - name: Set final commit status + uses: myrotvorets/set-commit-status-action@v2.0.1 + if: always() + with: + sha: ${{ steps.pr-branch-info.head_sha }} + status: ${{ job.status }} From 7c4aaddb5928ad9bd2bc376bc077ea5ff28b6bbe Mon Sep 17 00:00:00 2001 From: Josh Leyshon Date: Fri, 24 May 2024 21:36:13 +0930 Subject: [PATCH 2/6] Add "owner" field to app.json EAS config Signed-off-by: Josh Leyshon --- app.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.json b/app.json index 0a9ac89..277c5a8 100644 --- a/app.json +++ b/app.json @@ -34,6 +34,7 @@ "eas": { "projectId": "d0403539-b262-43fb-8bf5-25a9277b9181" } - } + }, + "owner": "ekswhyzed" } } From 2e8c67ecd0f1975239fc89f8238e11d34e10eb0f Mon Sep 17 00:00:00 2001 From: Josh Leyshon Date: Fri, 24 May 2024 21:59:50 +0930 Subject: [PATCH 3/6] CI uses node v20 now. Signed-off-by: Josh Leyshon --- .github/workflows/easBuild.yml | 4 ++-- .github/workflows/lintTestBuild.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/easBuild.yml b/.github/workflows/easBuild.yml index 9df76ed..8027871 100644 --- a/.github/workflows/easBuild.yml +++ b/.github/workflows/easBuild.yml @@ -27,10 +27,10 @@ jobs: - name: Checkout PR branch uses: actions/checkout@v3 - - name: Setup Node + - name: Install Node uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 20.x cache: npm - name: Setup EAS diff --git a/.github/workflows/lintTestBuild.yml b/.github/workflows/lintTestBuild.yml index 5c7ab7e..81113fd 100644 --- a/.github/workflows/lintTestBuild.yml +++ b/.github/workflows/lintTestBuild.yml @@ -16,7 +16,7 @@ jobs: - name: Install Node uses: actions/setup-node@v3 with: - node-version: '16' + node-version: 20.x cache: npm - name: Install deps run: npm ci @@ -35,7 +35,7 @@ jobs: - name: Install Node uses: actions/setup-node@v3 with: - node-version: '16' + node-version: 20.x cache: npm - name: Install deps run: npm ci @@ -52,7 +52,7 @@ jobs: - name: Install Node uses: actions/setup-node@v3 with: - node-version: '16' + node-version: 20.x cache: npm - name: Install deps run: npm ci @@ -69,7 +69,7 @@ jobs: - name: Install Node uses: actions/setup-node@v3 with: - node-version: '16' + node-version: 20.x cache: npm - name: Install deps run: npm ci From e8fb129f913743f5b7d1ffef4258ae3fbeafa4da Mon Sep 17 00:00:00 2001 From: Josh Leyshon Date: Fri, 24 May 2024 22:04:28 +0930 Subject: [PATCH 4/6] Use npm 10.7 instead of 10.8 Signed-off-by: Josh Leyshon --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 14c59fd..57dcb17 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "private": true, "volta": { "node": "20.13.1", - "npm": "10.8.0" + "// npm v10.8.0 breaks --json outputs": "", + "npm": "10.7.0" }, "scripts": { "start": "expo start --tunnel", From 9c7c74cdf58661ba3d1d798313254280474b1f7c Mon Sep 17 00:00:00 2001 From: Josh Leyshon Date: Fri, 24 May 2024 22:19:31 +0930 Subject: [PATCH 5/6] allow triggering the workflow manually, and actually checkout the correct branch Signed-off-by: Josh Leyshon --- .github/workflows/easBuild.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/easBuild.yml b/.github/workflows/easBuild.yml index 8027871..b0aee8a 100644 --- a/.github/workflows/easBuild.yml +++ b/.github/workflows/easBuild.yml @@ -1,6 +1,7 @@ name: EAS Build run-name: '${{ github.workflow }} - Requested by @${{github.actor}} (Run #${{github.run_number}})' on: + workflow_dispatch: issue_comment: types: [created] jobs: @@ -15,10 +16,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Get PR branch + if: github.event_name != 'workflow_dispatch' uses: xt0rted/pull-request-comment-branch@v2 id: pr-branch-info - name: Set commit status as pending + if: github.event_name != 'workflow_dispatch' uses: myrotvorets/set-commit-status-action@v2.0.1 with: sha: ${{ steps.pr-branch-info.head_sha }} @@ -26,6 +29,13 @@ jobs: - name: Checkout PR branch uses: actions/checkout@v3 + with: + ref: | + ${{ + github.event_name != 'workflow_dispatch' && + steps.comment-branch.outputs.head_ref || + github.sha + }} - name: Install Node uses: actions/setup-node@v3 From 9e193beace6c5e199fe5df5231fe750beffcc048 Mon Sep 17 00:00:00 2001 From: Josh Leyshon Date: Fri, 24 May 2024 22:21:05 +0930 Subject: [PATCH 6/6] . Signed-off-by: Josh Leyshon --- .github/workflows/easBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/easBuild.yml b/.github/workflows/easBuild.yml index b0aee8a..e9a212b 100644 --- a/.github/workflows/easBuild.yml +++ b/.github/workflows/easBuild.yml @@ -58,7 +58,7 @@ jobs: - name: Set final commit status uses: myrotvorets/set-commit-status-action@v2.0.1 - if: always() + if: always() && github.event_name != 'workflow_dispatch' with: sha: ${{ steps.pr-branch-info.head_sha }} status: ${{ job.status }}