feat: GH-68 Adds a build compatible with unpkg CDN #44
Workflow file for this run
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: Colour | |
on: | |
pull_request: | |
types: | |
- labeled | |
paths: | |
- '**' | |
jobs: | |
publish-rc: | |
name: Publish RC | |
runs-on: ubuntu-latest | |
if: github.event.label.name == 'Release Candidate' | |
permissions: | |
contents: write | |
id-token: write | |
pull-requests: write | |
repository-projects: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: "0" | |
- name: Configure Git User | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "@$GITHUB_ACTOR" | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: "https://registry.npmjs.org" | |
scope: "@sardine" | |
- name: "Setup npm" | |
run: | | |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build | |
- name: Build for unpkg | |
run: npx esbuild ./dist/index.mjs --minify --outfile=./dist/index.min.js | |
- name: Publish Colour Release Candidate | |
run: | | |
npx changeset pre enter rc | |
npx changeset version | |
npx changeset publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |