-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (69 loc) · 2.29 KB
/
client-cd.yaml
File metadata and controls
73 lines (69 loc) · 2.29 KB
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
name: Client CD (Expo EAS build)
on:
workflow_run:
workflows: ["Client CI (ESLint, Expo EAS build)"]
types:
- completed
push:
tags:
- "prod-[1-9]+.[0-9]+.[0-9]+" # Push events to matching prod-*, i.e.prod-20.15.10
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: rlespinasse/github-slug-action@v2.x
- name: Generate Changelog
id: changelog
uses: metcalfc/changelog-generator@v0.4.0
with:
myToken: ${{ secrets.GH_TOKEN }}
base-ref: 'prod-0'
- name: Creating Release
uses: ncipollo/release-action@v1
with:
body: |
Changes in this Release:
${{ steps.changelog.outputs.changelog }}
token: ${{ secrets.GH_TOKEN }}
name: Release ${{ env.GITHUB_REF_SLUG }}
allowUpdates: true
build:
needs: [create_release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: rlespinasse/github-slug-action@v2.x
- uses: actions/setup-node@v2
with:
node-version: 16.x
cache: npm
cache-dependency-path: client/package-lock.json
- name: Setup Expo and EAS
uses: expo/expo-github-action@v7
with:
expo-version: 5.x
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Build on EAS
run: |
cd client
eas build --platform android --non-interactive --profile production > buildLogAndroid.txt
cat buildLogAndroid.txt
- name: Parse Asset URL
id: androidUrl
run: |
cd client
ASSET_URL=$(cat buildLogAndroid.txt | tail | egrep -o 'https?://expo\.dev/artifacts/[^ ]+')
echo The android url is $ASSET_URL
echo "::set-output name=assetUrl::$ASSET_URL"
- name: Download APK Asset
run: wget -O example-${{ env.GITHUB_REF_SLUG }}.apk ${{ steps.androidUrl.outputs.assetUrl }}
- name: Upload Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GH_TOKEN }}
file: ./example-${{ env.GITHUB_REF_SLUG }}.apk
asset_name: release-${{ env.GITHUB_REF_SLUG }}.apk
tag: ${{ github.ref }}