Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims committed Aug 21, 2023
1 parent 3f9b34a commit 3c3891f
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Publish Release

on:
workflow_dispatch:
release:
types:
- published

permissions:
contents: read
packages: write

jobs:
publish-npm:
name: 'NPM'
runs-on: ubuntu-latest
environment: release

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Build release
run: rm -rf dist && rm -rf build && npm run dist && npm run build

- name: Publish release to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish release to CDN
run: ccu --trace

publish-gh:
needs: publish-npm # Don't publish to GitHub Packages until NPM is done

name: 'GitHub Packages'
runs-on: ubuntu-latest
environment: release

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Build release
run: rm -rf dist && rm -rf build && npm run dist && npm run build

- name: Publish release to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 3c3891f

Please sign in to comment.