Skip to content

Commit f394bc9

Browse files
authored
ci: update bump.yml to support monorepo (#89)
1 parent 282b4c2 commit f394bc9

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

.github/sync-client.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ lumirlumir/lumirlumir-configs:
1010
dest: ./configs/.github/ISSUE_TEMPLATE/3-others.md
1111
# ./.github/workflows
1212
- source: ./.github/workflows/bump.yml
13-
dest: ./configs/.github/workflows/bump.yml
13+
dest: ./configs/.github/workflows/monorepo-bump.yml
1414
- source: ./.github/workflows/labeler.yml
1515
dest: ./configs/.github/workflows/labeler.yml
1616
- source: ./.github/workflows/lint.yml

.github/workflows/bump.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- patch
1111
- minor
1212
- major
13+
- prerelease
14+
- prepatch
15+
- preminor
16+
- premajor
1317

1418
jobs:
1519
bump:
@@ -40,17 +44,26 @@ jobs:
4044
- name: Set up environment variables
4145
run: |
4246
echo "SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
43-
echo "OLD_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
47+
echo "OLD_VERSION=$(node -p "require('./lerna.json').version")" >> $GITHUB_ENV
4448
45-
- name: Bump
49+
- name: Set up git
4650
run: |
4751
git config --global user.name '루밀LuMir'
4852
git config --global user.email '[email protected]'
4953
git switch -c release-${{ inputs.type }}-${{ env.SHORT_SHA }}
50-
npm version ${{ inputs.type }} -m "release(${{ inputs.type }}): v%s"
54+
55+
- name: Bump version(patch, minor, major)
56+
if: ${{ inputs.type == 'patch' || inputs.type == 'minor' || inputs.type == 'major' }}
57+
run: |
58+
npx lerna version ${{ inputs.type }} -m "release(${{ inputs.type }}): %s" --no-push --no-private --yes
59+
60+
- name: Bump version(prerelease, prepatch, preminor, premajor)
61+
if: ${{ inputs.type == 'prerelease' || inputs.type == 'prepatch' || inputs.type == 'preminor' || inputs.type == 'premajor' }}
62+
run: |
63+
npx lerna version ${{ inputs.type }} -m "release(${{ inputs.type }}): %s" --preid canary --no-push --no-private --yes
5164
5265
- name: Set up environment variables
53-
run: echo "NEW_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
66+
run: echo "NEW_VERSION=$(node -p "require('./lerna.json').version")" >> $GITHUB_ENV
5467

5568
- name: Push
5669
run: git push --set-upstream origin release-${{ inputs.type }}-${{ env.SHORT_SHA }}

.github/workflows/test-cross-platform.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ jobs:
8989

9090
- name: Install packages
9191
if: runner.os != 'Windows'
92-
run: npm install $(find . -name "*.tgz")
92+
run: |
93+
npm install $(find . -name "clang-format-node-*.tgz")
94+
npm install $(find . -name "clang-format-git-*.tgz")
9395
9496
- name: Install packages
9597
if: runner.os == 'Windows'
96-
run: Get-ChildItem -Recurse -Filter *.tgz | ForEach-Object { npm install "file:$($_.FullName)" }
98+
run: |
99+
Get-ChildItem -Recurse -Filter "clang-format-node-*.tgz" | ForEach-Object { npm install $_.FullName }
100+
Get-ChildItem -Recurse -Filter "clang-format-git-*.tgz" | ForEach-Object { npm install $_.FullName }
97101
98102
- name: Test clang-format-git
99103
run: npx clang-format-git --help

0 commit comments

Comments
 (0)