2021-12-24 12:41:28 +05:30

72 lines
1.9 KiB
YAML

name: Publish NPM package + Docs
on:
release:
types: [created]
jobs:
publish_npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: npm install
- name: Publish NPM package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout play dl
uses: actions/checkout@v2
- name: Checkout play dl GitHub page repo
uses: actions/checkout@v2
with:
repository: play-dl/play-dl.github.io
path: docs
token: "${{ secrets.DOCS_TOKEN }}"
- name: Setup Node 16
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: npm install
- name: Deleting default exports for ESM.
run: node .github/docs.js
- name: TypeDoc
run: npx typedoc
- name: Adding, committing and Pushing
run: |
cd docs/
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add *
git commit -m "Automated Docs"
git push
publish_discord:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: Publish on discord
run: node .github/discord.js channel="888999793458835466" body="${{ github.event.release.body }}" tag="${{ github.event.release.tag_name }}"
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}