Skip to content

Commit bcccb70

Browse files
committed
ci: cut releases with release-it and a generated changelog
1.0.8 was bumped, tagged, released and published by hand, and CHANGELOG.md stopped at 1.0.6 under `@config-plugins/react-native-codepush`, a name this package has never been published under. release-it now derives all of it from the conventional commits since the last tag: the version bump, the CHANGELOG section, the annotated tag message and the GitHub release body. A `!` or a `BREAKING CHANGE:` footer bumps the major and shows up under the same `⚠ BREAKING CHANGES` heading in all three. The trigger is `workflow_dispatch` with an optional increment override, not a push to master. conventional-commits treats any commit as at least a patch, so pushing a README fix would otherwise ship a version. Backfilled 1.0.7 and 1.0.8 from git history and reshaped the older entries into the layout release-it writes, so the file reads as one thing.
1 parent 674b75f commit bcccb70

3 files changed

Lines changed: 145 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
increment:
7+
description: "Version increment. Leave empty to infer it from the conventional commits since the last tag."
8+
required: false
9+
default: ""
10+
type: choice
11+
options:
12+
- ""
13+
- patch
14+
- minor
15+
- major
16+
dry-run:
17+
description: "Run release-it without publishing, pushing or tagging."
18+
required: false
19+
default: false
20+
type: boolean
21+
22+
permissions:
23+
contents: write
24+
25+
jobs:
26+
release:
27+
name: Publish to npm
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v7
31+
with:
32+
# conventional-changelog needs the tags and every commit since the
33+
# last one to work out the bump and the changelog entries.
34+
fetch-depth: 0
35+
36+
- uses: actions/setup-node@v7
37+
with:
38+
node-version: 24
39+
cache: yarn
40+
registry-url: https://registry.npmjs.org/
41+
42+
- run: yarn install --frozen-lockfile
43+
44+
- run: yarn lint
45+
46+
- run: yarn test
47+
48+
- run: yarn build
49+
50+
# release-it pushes the version commit and the tag back to master, and
51+
# actions/checkout leaves the branch without an upstream to push to.
52+
- run: git branch --set-upstream-to=origin/${{ github.ref_name }}
53+
54+
- name: Release
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
58+
INCREMENT: ${{ inputs.increment }}
59+
DRY_RUN: ${{ inputs.dry-run }}
60+
run: |
61+
git config user.email "gabrielstaveira@gmail.com"
62+
git config user.name "Gabriel Taveira"
63+
64+
args="--ci"
65+
if [ -n "$INCREMENT" ]; then
66+
args="$args --increment=$INCREMENT"
67+
fi
68+
if [ "$DRY_RUN" = "true" ]; then
69+
args="$args --dry-run"
70+
fi
71+
72+
yarn release $args

CHANGELOG.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
1-
### @config-plugins/react-native-codepush 1.0.0
1+
# Changelog
22

3-
- Expo SDK 49 support
3+
## [1.0.8](https://github.com/GSTJ/react-native-code-push-plugin/compare/1.0.7...v1.0.8) (2026-07-25)
4+
5+
### Features
6+
7+
- support self-hosted codepush servers ([#11](https://github.com/GSTJ/react-native-code-push-plugin/issues/11))
8+
9+
### Bug Fixes
10+
11+
- let node resolve the codepush gradle paths ([#12](https://github.com/GSTJ/react-native-code-push-plugin/issues/12))
12+
13+
## [1.0.7](https://github.com/GSTJ/react-native-code-push-plugin/compare/1.0.6...1.0.7) (2024-02-08)
14+
15+
### Bug Fixes
416

5-
### @config-plugins/react-native-codepush 1.0.2
17+
- kotlin/java semicolon build error ([#7](https://github.com/GSTJ/react-native-code-push-plugin/issues/7))
618

7-
- Update interim README
19+
## 1.0.6 (2024-01-22)
820

9-
### @config-plugins/react-native-codepush 1.0.6
21+
### Features
1022

11-
- Expo SDK 50 support
23+
- Expo SDK 50 support ([#5](https://github.com/GSTJ/react-native-code-push-plugin/issues/5))
1224

13-
### @config-plugins/react-native-codepush 1.0.6
25+
### Bug Fixes
1426

15-
- Fix SDK 49 build error
27+
- Expo SDK 49 build error
28+
29+
## 1.0.2 (2023-11-06)
30+
31+
### Documentation
32+
33+
- update the interim README
34+
35+
## 1.0.0 (2023-11-06)
36+
37+
### Features
38+
39+
- Expo SDK 49 support

package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414
"build",
1515
"app.plugin.js"
1616
],
17+
"publishConfig": {
18+
"registry": "https://registry.npmjs.org/"
19+
},
1720
"scripts": {
1821
"build": "expo-module build",
1922
"clean": "expo-module clean",
2023
"lint": "expo-module lint",
2124
"test": "expo-module test",
2225
"prepare": "expo-module prepare",
2326
"prepublishOnly": "expo-module prepublishOnly",
27+
"release": "release-it",
2428
"expo-module": "expo-module"
2529
},
2630
"keywords": [
@@ -40,6 +44,43 @@
4044
"jest": "^29",
4145
"release-it": "^21.0.0"
4246
},
47+
"release-it": {
48+
"git": {
49+
"requireBranch": "master",
50+
"commitMessage": "chore(release): v${version} [skip ci]",
51+
"tagName": "v${version}",
52+
"tagAnnotation": "v${version}\n\n${changelog}"
53+
},
54+
"npm": {
55+
"publish": true
56+
},
57+
"github": {
58+
"release": true,
59+
"releaseName": "v${version}"
60+
},
61+
"plugins": {
62+
"@release-it/conventional-changelog": {
63+
"infile": "CHANGELOG.md",
64+
"header": "# Changelog",
65+
"preset": {
66+
"name": "conventionalcommits",
67+
"types": [
68+
{ "type": "feat", "section": "Features" },
69+
{ "type": "fix", "section": "Bug Fixes" },
70+
{ "type": "perf", "section": "Performance" },
71+
{ "type": "refactor", "section": "Code Refactoring" },
72+
{ "type": "docs", "section": "Documentation" },
73+
{ "type": "build", "section": "Build System" },
74+
{ "type": "ci", "section": "Continuous Integration" },
75+
{ "type": "chore", "section": "Chores" },
76+
{ "type": "revert", "section": "Reverts" },
77+
{ "type": "test", "hidden": true },
78+
{ "type": "style", "hidden": true }
79+
]
80+
}
81+
}
82+
}
83+
},
4384
"resolutions": {
4485
"**/@expo/plist/@xmldom/xmldom": "0.8.13",
4586
"**/@typescript-eslint/typescript-estree/minimatch": "9.0.7",

0 commit comments

Comments
 (0)