Skip to content

Commit f4c1315

Browse files
authored
ci: add docs bump gh action workflow (react-native-elements#3704)
1 parent 800edbb commit f4c1315

File tree

4 files changed

+80
-4
lines changed

4 files changed

+80
-4
lines changed

.github/actions/install/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
- name: Setup Node.js Env
1313
uses: actions/setup-node@v2
1414
with:
15-
node-version: 18
15+
node-version: 16
1616
- name: Cache dependencies
1717
uses: actions/cache@v2
1818
id: root_cache

.github/workflows/bump-version.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: (manual PR) Bump release version
2+
3+
on:
4+
workflow_dispatch:
5+
name:
6+
version:
7+
type: string
8+
description: Release name
9+
required: true
10+
11+
jobs:
12+
publish:
13+
continue-on-error: true
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: 🏗 Setup repo
18+
uses: actions/checkout@v2
19+
20+
- name: Install dependencies
21+
uses: ./.github/actions/install
22+
23+
- name: Set env
24+
run: |
25+
BRANCH_NAME="bump-docs-$(date "+%Y%m%d%H%M%S")"
26+
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
27+
28+
- name: Bump docs version
29+
working-directory: website
30+
run: |
31+
yarn version ${{github.event.inputs.name}}
32+
33+
- name: Bump base version
34+
working-directory: packages/base
35+
run: |
36+
npm version v${{github.event.inputs.name}}
37+
- name: Bump themed version
38+
working-directory: packages/themed
39+
run: |
40+
npm version v${{github.event.inputs.name}}
41+
42+
- name: Config git
43+
run: |
44+
git config --local user.email "[email protected]"
45+
git config --local user.name "RNEUI"
46+
47+
- name: Checkout
48+
run: |
49+
git add .
50+
git commit -m "Bump v${{github.event.inputs.pr}}"
51+
git checkout -b ${{ env.BRANCH_NAME }}
52+
git push --set-upstream origin ${{ env.BRANCH_NAME }} --force
53+
54+
- name: Create Pull Request
55+
continue-on-error: true
56+
uses: actions/github-script@v6
57+
with:
58+
script: |
59+
const { repo, owner } = context.repo;
60+
const result = await github.rest.pulls.create({
61+
title: 'chore: bump v${{github.event.inputs.pr}}',
62+
owner,
63+
repo,
64+
head: '${{ env.BRANCH_NAME }}',
65+
base: 'next',
66+
body: [
67+
'This PR is auto-generated by',
68+
'[actions/github-script](https://github.com/actions/github-script).'
69+
].join('\n')
70+
});
71+
github.rest.issues.addLabels({
72+
owner,
73+
repo,
74+
issue_number: result.data.number,
75+
labels: ['feature', 'automated pr', 'need-review']
76+
});

.github/workflows/expo-preview-PR.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: (manual) Expo preview Channel
1+
name: (manual) PR's Expo preview Channel
22

33
on:
44
workflow_dispatch:

.github/workflows/upgrade-expo-sdk.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: (manual) Upgrade expo SDK
1+
name: (manual PR) Upgrade expo SDK
22

33
on:
44
workflow_dispatch:
@@ -45,7 +45,7 @@ jobs:
4545
script: |
4646
const { repo, owner } = context.repo;
4747
const result = await github.rest.pulls.create({
48-
title: '[Example] Simple demo',
48+
title: 'example: upgrade expo SDK to latest',
4949
owner,
5050
repo,
5151
head: '${{ env.BRANCH_NAME }}',

0 commit comments

Comments
 (0)