Skip to content

Release/v0.3.0

Release/v0.3.0 #20

Workflow file for this run

name: Release
on:
pull_request:
types:
- closed
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Upload an artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist
publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: DownLoad an Artifact
uses: actions/download-artifact@v3
with:
name: dist
path: ./dist
- name: Publish to npm
run: yarn publish
if: env.NODE_AUTH_TOKEN != ''
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
notify-success:
runs-on: ubuntu-latest
needs: publish
if: success()
steps:
- uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
username: Github Actions
status: ${{ job.status }}
title: ${{ github.head_ref }}
url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
color: 0x006afe
notify-fail:
runs-on: ubuntu-latest
needs: publish
if: failure()
steps:
- uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
username: Github Actions
status: ${{ job.status }}
title: ${{ github.head_ref }}
url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
color: 0xff4433