-
-
Notifications
You must be signed in to change notification settings - Fork 10
65 lines (63 loc) · 2.18 KB
/
bump_version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Bump version
on:
push:
branches:
- main
- development
jobs:
bump-version:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
runs-on: ubuntu-latest
name: 'Bump version and create changelog with standard version'
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}'
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies
id: install_code
run: pnpm install --frozen-lockfile
- name: Git config
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
- name: Create bump and changelog main
if: github.ref == 'refs/heads/main'
run: pnpm dlx capacitor-plugin-standard-version@latest
- name: Create bump and changelog development
if: github.ref != 'refs/heads/main'
run: pnpm dlx capacitor-plugin-standard-version@latest --prerelease alpha
- name: Push to origin
run: |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
remote_repo="https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
git pull $remote_repo $CURRENT_BRANCH
git push $remote_repo HEAD:$CURRENT_BRANCH --follow-tags --tags
create-cache:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
runs-on: ubuntu-latest
name: 'Create global cache on main branch'
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies
id: install_code
run: pnpm install --frozen-lockfile
- name: CLI capacitor-standard-version install
run: pnpm dlx capacitor-standard-version@latest --version