Publish npm v2.8.2 (#274) #61
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: UPDATE CLI Package | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update-cli-version: | |
if: "${{contains(github.event.head_commit.message, 'chore(main): release')}}" | |
runs-on: ubuntu-latest | |
steps: | |
- name: git-checkout | |
uses: actions/checkout@v2 | |
- name: Update CLI package.json | |
run: | | |
ROOT_VERSION=$(jq -r '.version' package.json) | |
NEW_BRANCH="npm-pull-request-of-v${ROOT_VERSION}" | |
echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV | |
echo "NEW_VERSION=$ROOT_VERSION" >> $GITHUB_ENV | |
# git checkout -b $NEW_BRANCH | |
jq ".version = \"$ROOT_VERSION\"" packages/cli/package.json > temp.json && mv temp.json packages/cli/package.json | |
# git config --local user.email "[email protected]" | |
# git config --local user.name "Github Action" | |
- name: Push to New Branch | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: ${{env.NEW_BRANCH}} # The branch name where you want to push the assets | |
FOLDER: packages/cli # The directory where your assets are generated | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub will automatically add this - you don't need to bother getting a token | |
MESSAGE: "chore(cli): sync package version to cli" # The commit message | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "chore(cli): release npm version of ${{ env.NEW_VERSION }}" | |
title: "Publish npm v${{ env.NEW_VERSION }}" | |
body: "Update npm package version to ${{ env.NEW_VERSION }}" | |
branch: "npm-pull-request-of-v${{ env.NEW_VERSION }}" | |
base: main | |
labels: npm | |
id: cpr |