generated from atls-lab/template-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.72 KB
/
release.yaml
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
name: Release
on:
pull_request:
types:
- closed
branches:
- master
workflow_dispatch:
jobs:
Release:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PUBLIVERSIONER_ID }}
private-key: ${{ secrets.PUBLIVERSIONER_SECRET }}
- name: Checkout
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
- name: Setup Node
uses: actions/setup-node@v4
- name: Bump version
run: yarn workspace @rn-demo-app/app version patch
- name: Build Android app
run: yarn workspace @rn-demo-app/app run android --mode=release
- name: Commit changes
if: ${{ !cancelled() }}
id: committer
uses: EndBug/add-and-commit@v9
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
with:
default_author: github_actions
author_email: github-bot@rees46.com
message: 'chore(common): version bump'
add: '["*.json"]'
- name: Create Release
if: ${{ !cancelled() && steps.committer.outputs.committed == 'true' }}
working-directory: ./rn-demo-app/app
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
yarn exec 'bash -c \
"VERSION=\$npm_package_version; \
gh release create \"\$VERSION\" ./android/app/build/outputs/apk/release/app-release.apk ;"'