forked from awran5/react-simple-star-rating
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump(patch) - Setup build process and github actions
- Loading branch information
Showing
3 changed files
with
18,720 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: CI | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the master branch | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
env: | ||
TAG: patch | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- shell: bash | ||
name: "Parse GIT Information" | ||
run: | | ||
commit_message=$(git log --format=%B -n 1 ${{ github.sha }}) | ||
echo "MESSAGE=$commit_message" >> $GITHUB_ENV | ||
- shell: bash | ||
name: "Generate new version" | ||
run: | | ||
regex='^bump\((minor|patch|major)\)' | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
if [[ $MESSAGE =~ $regex ]]; then | ||
npm version $(echo ${BASH_REMATCH[1]}) | ||
else | ||
npm version prerelease --preid=$(git log --pretty=format:'%h' -n 1) | ||
fi | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.x' | ||
|
||
- name: "Setup registry" | ||
run: | | ||
echo "//npm.pkg.github.com/:_authToken=$NPM_TOKEN" > ~/.npmrc | ||
env: | ||
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- run: npm publish --registry https://npm.pkg.github.com | ||
env: | ||
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- shell: bash | ||
name: "Push New version" | ||
if: success() | ||
run: | | ||
git push origin --follow-tags |
Oops, something went wrong.