Skip to content

Commit 85c99d9

Browse files
authored
chore(ci): Refactor release workflow (#71)
* chore(ci): Refactor release workflow * Improve package.json information and use a .releaserc.json file * Make `pages.yml` reusable and add it to the release pipeline * Test release workflow on this branch with `--dry-run` enabled * Fix pages job file reference * Revert dry-run test changes * Filter out `release` branch on `ci.yml` workflow
1 parent c4c9d29 commit 85c99d9

File tree

6 files changed

+52
-22
lines changed

6 files changed

+52
-22
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
---
22
name: CI
33

4-
on: push
4+
on:
5+
push:
6+
branches-ignore: [release]
7+
workflow_call:
58

69
concurrency:
710
group: ci-${{ github.ref_name }}

.github/workflows/pages.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
name: Pages
33

44
on:
5-
workflow_run:
6-
workflows: [Release]
7-
branches: [release]
8-
types: [completed]
5+
workflow_call:
96

107
permissions:
118
contents: read
@@ -18,14 +15,11 @@ concurrency:
1815

1916
jobs:
2017
build:
21-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2218
runs-on: ubuntu-latest
2319

2420
steps:
2521
- name: Checkout
2622
uses: actions/checkout@v3
27-
with:
28-
ref: release
2923
- name: Setup Pages
3024
uses: actions/configure-pages@v2
3125
- name: Build with Jekyll

.github/workflows/release.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
name: Release
33

44
on:
5-
workflow_run:
6-
workflows: [CI]
7-
types: [completed]
5+
push:
86
branches: [release]
97

108
concurrency:
119
group: release
1210
cancel-in-progress: true
1311

1412
jobs:
13+
build:
14+
uses: ./.github/workflows/ci.yml
15+
1516
deploy:
16-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1717
runs-on: ubuntu-latest
18+
needs: [build]
19+
1820
steps:
1921
- uses: actions/checkout@v3
20-
with:
21-
ref: release
2222
- uses: actions/setup-node@v3
2323
with:
2424
node-version-file: '.nvmrc'
@@ -29,3 +29,7 @@ jobs:
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
33+
pages:
34+
uses: ./.github/workflows/pages.yml
35+
needs: [deploy]

.releaserc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"branches": [
3+
"release"
4+
]
5+
}

package.json

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,22 @@
33
"version": "0.0.0",
44
"description": "React Native library to implement a highly customizable app tour feature with an awesome spotlight effect",
55
"repository": "[email protected]:stackbuilders/react-native-spotlight-tour.git",
6-
"author": "Stack Builders <[email protected]>",
6+
"homepage": "https://stackbuilders.github.io/react-native-spotlight-tour/",
7+
"bugs": "https://github.com/stackbuilders/react-native-spotlight-tour/issues",
8+
"author": "Stack Builders <[email protected]> (https://github.com/stackbuilders)",
79
"license": "MIT",
10+
"keywords": [
11+
"app-tour",
12+
"android",
13+
"customizable",
14+
"ios",
15+
"react-native",
16+
"step-by-step",
17+
"spotlight",
18+
"spotlight-tour",
19+
"tour",
20+
"user-guide"
21+
],
822
"main": "./dist/index.js",
923
"types": "./dist/index.d.ts",
1024
"react-native": "./src/index.ts",
@@ -55,13 +69,16 @@
5569
"react-native": ">=0.50.0",
5670
"react-native-svg": ">=12.1.0"
5771
},
58-
"release": {
59-
"branches": [
60-
"release"
61-
]
62-
},
63-
"publishConfig": {
64-
"access": "public"
72+
"peerDependenciesMeta": {
73+
"react": {
74+
"optional": false
75+
},
76+
"react-native": {
77+
"optional": false
78+
},
79+
"react-native-svg": {
80+
"optional": false
81+
}
6582
},
6683
"packageManager": "[email protected]"
6784
}

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,6 +2677,13 @@ __metadata:
26772677
react: ">=16.8.0"
26782678
react-native: ">=0.50.0"
26792679
react-native-svg: ">=12.1.0"
2680+
peerDependenciesMeta:
2681+
react:
2682+
optional: false
2683+
react-native:
2684+
optional: false
2685+
react-native-svg:
2686+
optional: false
26802687
languageName: unknown
26812688
linkType: soft
26822689

0 commit comments

Comments
 (0)