-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.45 KB
/
build-release.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build Release
on:
pull_request:
types:
- closed
branches:
- 'release/**'
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
outputs:
eas_build_url: ${{ steps.build.outputs.eas_build_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build
id: build
# Check whether EAS build needs the sha of the commit to build
run: |
eas_build_url=$( echo 'Run EAS build here, ideally with nowait' )
echo "eas_build_url=$eas_build_url" >> $GITHUB_OUTPUT
comment:
name: Comment
runs-on: ubuntu-latest
needs: build
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.RELEASE_BOT_APP_ID }}
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
- name: Comment on PR
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
COMMENT_BODY: |
:rocket: Release build based on ${{ github.event.pull_request.merge_commit_sha }}: ${{ needs.build.outputs.eas_build_url }}
run: |
gh pr comment $PR_NUMBER --body "$COMMENT_BODY" --repo "$GITHUB_REPOSITORY"