Update version-bump.yml #4
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: Version Bump and Release | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
bump-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: yarn install | |
- name: Bump version | |
run: | | |
yarn version --patch --no-commit-hooks --no-git-tag-version | |
- name: Get new version | |
id: new_version | |
run: echo "NEW_VERSION=$(node -p -e \"require('./package.json').version\")" >> $github.env | |
- name: Commit and push changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add package.json yarn.lock | |
git commit -m "Bump version to ${{ env.NEW_VERSION }} [skip ci]" | |
git tag "v${{ env.NEW_VERSION }}" | |
git push --follow-tags | |
- name: Create a pull request for the new version | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
branch: bump-version | |
commit-message: "Bump version to ${{ env.NEW_VERSION }}" | |
title: "Bump version to ${{ env.NEW_VERSION }}" | |
body: "This PR bumps the package version to ${{ env.NEW_VERSION }}." | |
labels: version-bump | |
notify-users: | |
needs: bump-version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send notification to users | |
run: | | |
echo "Sending notification to users about the new version..." | |
# Customize this step to send notifications through email, Slack, or other channels. |