Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
fix: flowの手順を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yuito-it committed Apr 8, 2024
1 parent 69c0bdb commit b68ba5d
Showing 1 changed file with 8 additions and 64 deletions.
72 changes: 8 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,75 +31,19 @@ jobs:
- name: Update Version
if: ${{ env.NPM_VERSION != env.NPM_NEW_VERSION }}
run: npm version patch

- name: Push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push -u origin ${{ github.event.pull_request.head.ref }}

Minor:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || contains(github.event.pull_request.labels[*].name, 'minor') }}
steps:
- name: Checkout Base Branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: Version Get
run: |
NPM_VERSION=$(node -e "console.log(require('./package.json').version)")
printf "NPM_VERSION=%s" "$NPM_VERSION" >> $GITHUB_ENV
- name: Checkout PR Branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Version Get
run: |
NPM_NEW_VERSION=$(node -e "console.log(require('./package.json').version)")
printf "NPM_NEW_VERSION=%s" "$NPM_NEW_VERSION" >> $GITHUB_ENV
npm version patch
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Update Version
- name: Commit changes
if: ${{ env.NPM_VERSION != env.NPM_NEW_VERSION }}
run: npm version minor

- name: Push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push -u origin ${{ github.event.pull_request.head.ref }}

Major:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || contains(github.event.pull_request.labels[*].name, 'major') }}
steps:
- name: Checkout Base Branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}

- name: Version Get
run: |
NPM_VERSION=$(node -e "console.log(require('./package.json').version)")
printf "NPM_VERSION=%s" "$NPM_VERSION" >> $GITHUB_ENV
- name: Checkout PR Branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Version Get
run: |
NPM_NEW_VERSION=$(node -e "console.log(require('./package.json').version)")
printf "NPM_NEW_VERSION=%s" "$NPM_NEW_VERSION" >> $GITHUB_ENV
git commit -am "Bump version to $NPM_NEW_VERSION"
- name: Update Version
- name: Push changes
if: ${{ env.NPM_VERSION != env.NPM_NEW_VERSION }}
run: npm version major

- name: Push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push -u origin ${{ github.event.pull_request.head.ref }}
run: |
git push -u origin ${{ github.event.pull_request.head.ref }}

0 comments on commit b68ba5d

Please sign in to comment.