Merge pull request #76 from funnyzak/dependabot/npm_and_yarn/eslint-8… #134
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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
lint-and-test: | |
name: Lint and Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x, 16.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://registry.npmjs.org/' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Code test | |
run: npm run test | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [lint-and-test] | |
if: startsWith(github.ref, 'refs/tags/') | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build changelog | |
id: build_changelog | |
uses: mikepenz/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
configuration: '.github/config/changelog_configuration.json' | |
ignorePreReleases: 'false' | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: ${{steps.build_changelog.outputs.changelog}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
publish-npm: | |
name: Publish NPM | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: 'https://registry.npmjs.org/' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Code test | |
run: npm run test | |
- name: Build | |
run: npm run compile | |
- name: Get the version | |
id: get_version | |
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) | |
- name: Publish to NPM | |
id: publish | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
package: ./package.json | |
tag: latest | |
registry: https://registry.npmjs.org/ | |
access: public | |
check-version: true | |
- if: steps.publish.outputs.type != 'none' | |
run: | | |
echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" | |
- name: Push Publish Message | |
uses: funnyzak/pushoo-action@main | |
with: | |
platforms: ifttt,wecombot,bark | |
tokens: ${{ secrets.PUSH_TOKEN }} | |
content: | | |
# ${{github.repository}}:${{ steps.publish.outputs.version }} Npm Publish | |
## Npm Pakcge Link: https://www.npmjs.com/package/${{github.event.repository.name}} | |
options: '{"bark": { "url": "https://www.npmjs.com/package/${{github.event.repository.name}}" }}' | |
debug: false | |
push-release-message: | |
name: Push Release Message | |
runs-on: ubuntu-latest | |
needs: [release] | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Push Release Message | |
uses: funnyzak/pushoo-action@main | |
with: | |
platforms: ifttt,wecombot,bark | |
tokens: ${{ secrets.PUSH_TOKEN }} | |
content: | | |
# ${{ github.event.repository.name }} Released | |
## trigger: ${{ github.event_name }} at ${{ github.event.head_commit.timestamp }} | |
## commit message: ${{ github.event.head_commit.message }} | |
## commit url: ${{ github.event.head_commit.url }} | |
## commit author: ${{ github.event.head_commit.author.name }} | |
## commit email: ${{ github.event.head_commit.author.email }} | |
## commit id: ${{ github.event.head_commit.id }} | |
title: | | |
${{ github.repository }} ${{ github.event_name }} Message | |
options: '{"bark": { "url": "https://github.com/${{github.repository}}" }}' | |
debug: false | |