Merge pull request #58 from melfore/55-chore-setup-husky-hooks #25
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: Clibelt CI - Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
ref: master | |
- name: Install NodeJS | |
uses: actions/setup-node@master | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- name: Cache Dependencies | |
id: cache-dependencies | |
uses: actions/cache@master | |
env: | |
cache-name: clibelt-dependencies | |
with: | |
path: node_modules | |
key: clibelt-dependencies-${{ hashFiles('**/package-lock.json') }} | |
- name: Install Dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Git Config | |
run: | | |
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}" | |
git config --local user.name "${{ secrets.GIT_USER_NAME }}" | |
git pull | |
- name: Unit Tests | |
run: npm test | |
env: | |
CI: true | |
- name: Run Prettier | |
id: run-prettier | |
run: | | |
npm run prettify | |
echo "::set-output name=changed-files::$(git status -s -uno | wc -l)" | |
- name: Commit Changes | |
if: steps.run-prettier.outputs.changed-files > 0 | |
run: | | |
git add . | |
git commit -m "Release Ops" -a | |
- name: Increase Version | |
run: npm version patch | |
- name: Push Updates | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Package | |
run: npm run upload | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Send Notification | |
uses: Co-qn/google-chat-notification@master | |
with: | |
name: Clibelt - Release | |
url: ${{ secrets.GOOGLE_CHAT }} | |
status: ${{ job.status }} | |
if: always() |