Skip to content

Commit

Permalink
chore(ci): Refactor release workflow (#71)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
JoseLion authored Nov 10, 2022
1 parent c4c9d29 commit 85c99d9
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 22 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
---
name: CI

on: push
on:
push:
branches-ignore: [release]
workflow_call:

concurrency:
group: ci-${{ github.ref_name }}
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
name: Pages

on:
workflow_run:
workflows: [Release]
branches: [release]
types: [completed]
workflow_call:

permissions:
contents: read
Expand All @@ -18,14 +15,11 @@ concurrency:

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

steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: release
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Build with Jekyll
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
name: Release

on:
workflow_run:
workflows: [CI]
types: [completed]
push:
branches: [release]

concurrency:
group: release
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/ci.yml

deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
needs: [build]

steps:
- uses: actions/checkout@v3
with:
ref: release
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
Expand All @@ -29,3 +29,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

pages:
uses: ./.github/workflows/pages.yml
needs: [deploy]
5 changes: 5 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"branches": [
"release"
]
}
33 changes: 25 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@
"version": "0.0.0",
"description": "React Native library to implement a highly customizable app tour feature with an awesome spotlight effect",
"repository": "git@github.com:stackbuilders/react-native-spotlight-tour.git",
"author": "Stack Builders <info@stackbuilders.com>",
"homepage": "https://stackbuilders.github.io/react-native-spotlight-tour/",
"bugs": "https://github.com/stackbuilders/react-native-spotlight-tour/issues",
"author": "Stack Builders <info@stackbuilders.com> (https://github.com/stackbuilders)",
"license": "MIT",
"keywords": [
"app-tour",
"android",
"customizable",
"ios",
"react-native",
"step-by-step",
"spotlight",
"spotlight-tour",
"tour",
"user-guide"
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"react-native": "./src/index.ts",
Expand Down Expand Up @@ -55,13 +69,16 @@
"react-native": ">=0.50.0",
"react-native-svg": ">=12.1.0"
},
"release": {
"branches": [
"release"
]
},
"publishConfig": {
"access": "public"
"peerDependenciesMeta": {
"react": {
"optional": false
},
"react-native": {
"optional": false
},
"react-native-svg": {
"optional": false
}
},
"packageManager": "yarn@3.2.1"
}
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2677,6 +2677,13 @@ __metadata:
react: ">=16.8.0"
react-native: ">=0.50.0"
react-native-svg: ">=12.1.0"
peerDependenciesMeta:
react:
optional: false
react-native:
optional: false
react-native-svg:
optional: false
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 85c99d9

Please sign in to comment.