Lerna Publish #1003
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lerna Publish | |
on: workflow_dispatch | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Cache Yarn modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.yarn/cache | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install dependencies | |
run: yarn install | |
- name: Install Lerna | |
run: yarn global add [email protected] | |
- name: Configure Git identity | |
run: | | |
git config --global user.name "aguescribano87" | |
git config --global user.email "[email protected]" | |
- name: Create new branch | |
run: | | |
git checkout -b release-branch | |
- name: Run Lerna version | |
run: yarn lerna version patch --yes | |
- name: Push changes to new branch | |
run: | | |
git push origin release-branch --follow-tags | |
- name: Create Pull Request | |
id: pr | |
uses: repo-sync/pull-request@v2 | |
with: | |
source_branch: release-branch | |
destination_branch: master | |
pr_title: 'Lerna Publish PR' | |
pr_body: 'This PR was automatically created by the Lerna Publish workflow.' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Merge PR | |
if: steps.pr.outputs.pull_request_number | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.pulls.merge({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: ${{ steps.pr.outputs.pull_request_number }}, | |
merge_method: 'squash', | |
}) | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout and update development branch | |
run: | | |
git fetch origin development | |
git checkout development | |
git merge master | |
git push origin development --follow-tags |