-
Notifications
You must be signed in to change notification settings - Fork 3
116 lines (105 loc) · 3.41 KB
/
apk-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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: RTMIS APK build
on:
push:
branches:
- main
paths:
- app/**
jobs:
release:
name: apk build
runs-on: ubuntu-latest
steps:
- name: 🗄️ Checkout repository
uses: actions/checkout@v3
- name: 🧰 Setup node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: 🏗 Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: 📦 Install dependencies
run: |
cd ./app/
cp ./src/build.testing.js ./src/build.js
npm install
- name: 🚀 Release to Expo Dev
id: eas_release
working-directory: ./app
run: |
npm run eas:release > output.txt
cat output.txt
echo "APK_URL=$(tail -n 1 output.txt)" >> $GITHUB_ENV
- name: Set short git commit SHA
id: vars
run: |
shortSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$shortSha" >> $GITHUB_ENV
- name: Get App Version
id: get_version
run: |
cd app
apk_version=$(grep '"version":' package.json | sed -E 's/.*"version": *"([^"]+)".*/\1/')
echo "APK_VERSION=$apk_version" >> $GITHUB_ENV
- name: Send custom JSON data to Slack workflow
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":iphone: [TEST] New APK build just released - ${{ env.APK_VERSION }}",
"emoji": true
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*URL:*\n<${{ env.APK_URL }}>"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Commit ID:*\n<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|${{ env.COMMIT_SHORT_SHA }}>"
},
{
"type": "mrkdwn",
"text": "*Created by:*\n${{ github.actor }}"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
- name: 🌟 Send APK
env:
APK_VERSION: ${{ env.APK_VERSION }}
SECRET: ${{ secrets.APK_UPLOAD_SECRET }}
SENTRY_ENV: production
SENTRY_DSN: ${{ secrets.SENTRY_MOBILE_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_MOBILE_AUTH_TOKEN }}
run: |
curl -X 'POST' \
'https://rtmis.akvotest.org/api/v1/device/apk/upload' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"apk_url": "'"$APK_URL"'",
"apk_version": "'"$APK_VERSION"'",
"secret": "'"$SECRET"'"
}'