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

Commit

Permalink
fix: masterのコミットメッセージで判断
Browse files Browse the repository at this point in the history
  • Loading branch information
yuito-it committed Apr 12, 2024
1 parent 0bebdc1 commit c48aa36
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 129 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/bump.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bump Version and Publish

on:
push:
branches:
- master

jobs:
bump_and_publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node.js and npm
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Set up Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
- name: Determine version bump
id: determine_bump
run: |
COMMIT_MESSAGE=$(git log --format=%B -n 1 $GITHUB_SHA)
if echo "$COMMIT_MESSAGE" | grep -q '\[Major\]'; then
echo "::set-output name=bump::major"
elif echo "$COMMIT_MESSAGE" | grep -q '\[Minor\]'; then
echo "::set-output name=bump::minor"
elif echo "$COMMIT_MESSAGE" | grep -q '\[Patch]'; then
echo "::set-output name=bump::patch"
elif echo "$COMMIT_MESSAGE" | grep -q '\[Prerelease]'; then
echo "::set-output name=bump::prerelease"
elif echo "$COMMIT_MESSAGE" | grep -q '\[Prepatch]'; then
echo "::set-output name=bump::prepatch"
else
exit 1;
fi
- name: Bump version and publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: |
npm version ${{ steps.determine_bump.outputs.bump }}
git push --follow-tags
129 changes: 0 additions & 129 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit c48aa36

Please sign in to comment.