Skip to content

Commit

Permalink
ci: update bump.yml to support monorepo (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
lumirlumir authored Nov 8, 2024
1 parent 282b4c2 commit f394bc9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/sync-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ lumirlumir/lumirlumir-configs:
dest: ./configs/.github/ISSUE_TEMPLATE/3-others.md
# ./.github/workflows
- source: ./.github/workflows/bump.yml
dest: ./configs/.github/workflows/bump.yml
dest: ./configs/.github/workflows/monorepo-bump.yml
- source: ./.github/workflows/labeler.yml
dest: ./configs/.github/workflows/labeler.yml
- source: ./.github/workflows/lint.yml
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
- patch
- minor
- major
- prerelease
- prepatch
- preminor
- premajor

jobs:
bump:
Expand Down Expand Up @@ -40,17 +44,26 @@ jobs:
- name: Set up environment variables
run: |
echo "SHORT_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
echo "OLD_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
echo "OLD_VERSION=$(node -p "require('./lerna.json').version")" >> $GITHUB_ENV
- name: Bump
- name: Set up git
run: |
git config --global user.name '루밀LuMir'
git config --global user.email 'rpfos@naver.com'
git switch -c release-${{ inputs.type }}-${{ env.SHORT_SHA }}
npm version ${{ inputs.type }} -m "release(${{ inputs.type }}): v%s"
- name: Bump version(patch, minor, major)
if: ${{ inputs.type == 'patch' || inputs.type == 'minor' || inputs.type == 'major' }}
run: |
npx lerna version ${{ inputs.type }} -m "release(${{ inputs.type }}): %s" --no-push --no-private --yes
- name: Bump version(prerelease, prepatch, preminor, premajor)
if: ${{ inputs.type == 'prerelease' || inputs.type == 'prepatch' || inputs.type == 'preminor' || inputs.type == 'premajor' }}
run: |
npx lerna version ${{ inputs.type }} -m "release(${{ inputs.type }}): %s" --preid canary --no-push --no-private --yes
- name: Set up environment variables
run: echo "NEW_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
run: echo "NEW_VERSION=$(node -p "require('./lerna.json').version")" >> $GITHUB_ENV

- name: Push
run: git push --set-upstream origin release-${{ inputs.type }}-${{ env.SHORT_SHA }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ jobs:

- name: Install packages
if: runner.os != 'Windows'
run: npm install $(find . -name "*.tgz")
run: |
npm install $(find . -name "clang-format-node-*.tgz")
npm install $(find . -name "clang-format-git-*.tgz")
- name: Install packages
if: runner.os == 'Windows'
run: Get-ChildItem -Recurse -Filter *.tgz | ForEach-Object { npm install "file:$($_.FullName)" }
run: |
Get-ChildItem -Recurse -Filter "clang-format-node-*.tgz" | ForEach-Object { npm install $_.FullName }
Get-ChildItem -Recurse -Filter "clang-format-git-*.tgz" | ForEach-Object { npm install $_.FullName }
- name: Test clang-format-git
run: npx clang-format-git --help
Expand Down

0 comments on commit f394bc9

Please sign in to comment.