Skip to content

Commit 66d6ac6

Browse files
authored
Update README.md
1 parent b03a62b commit 66d6ac6

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,49 @@ Default config for standard-version for capacitor app
55
use it at builtin replacement of https://www.npmjs.com/package/standard-version
66

77
All config from .versionrc, .versionrc.json or .versionrc.js are supported
8+
9+
10+
## Install
11+
12+
13+
`npm i capacitor-standard-version`
14+
15+
Then run `npx capacitor-standard-version` for update main version or `npx capacitor-standard-version --prerelease alpha` for alpha release for dev branch.
16+
17+
Exemple of Github action to do it on every commit in `main` and `development`
18+
19+
```yml
20+
on:
21+
push:
22+
branches:
23+
- main
24+
- development
25+
26+
jobs:
27+
bump-version:
28+
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
29+
runs-on: ubuntu-latest
30+
name: "Bump version and create changelog with standard version"
31+
steps:
32+
- name: Check out
33+
uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 0
36+
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}'
37+
- name: Git config
38+
run: |
39+
git config --local user.name "github-actions[bot]"
40+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
41+
- name: Create bump and changelog
42+
if: github.ref == 'refs/heads/main'
43+
run: npx capacitor-standard-version
44+
- name: Create bump and changelog
45+
if: github.ref != 'refs/heads/main'
46+
run: npx capacitor-standard-version --prerelease alpha
47+
- name: Push to origin
48+
run: |
49+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
50+
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
51+
git pull $remote_repo $CURRENT_BRANCH
52+
git push $remote_repo HEAD:$CURRENT_BRANCH --follow-tags --tags
53+
```

0 commit comments

Comments
 (0)