Merge pull request #147 from oke-py/package-version

fix: automatically update package version
This commit is contained in:
Naoki Oketani
2022-12-11 20:51:12 +09:00
committed by GitHub

View File

@@ -7,25 +7,43 @@ on:
jobs:
minor:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == "release minor" }}
if: ${{ github.event.label.name == 'release minor' }}
steps:
- name: check out repository code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: git config
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: increment minor version
run: |
npm version minor
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "release: automated change"
- name: git push
run: |
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
git push origin HEAD:${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
patch:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == "release patch" }}
if: ${{ github.event.label.name == 'release patch' }}
steps:
- name: check out repository code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: git config
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: increment patch version
run: |
npm version patch
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "release: automated change"
- name: git push
run: |
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
git push origin HEAD:${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}