1.3.8 #21
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: Publish New Release | |
on: | |
release: | |
types: [created] | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://registry.npmjs.org/ | |
- run: sudo apt-get install jq | |
- run: jq ".version=\"${GITHUB_REF#refs/*/}\"" package.json > package-new.json && mv package-new.json package.json | |
- run: cat package.json | |
- run: npm i -g pnpm | |
- run: pnpm i | |
- run: pnpm test | |
- run: pnpm publish-npm | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}} | |
deploy-demo: | |
needs: publish-npm | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm i -g pnpm | |
- run: pnpm i | |
- run: pnpm --prefix demo i | |
- run: pnpm --prefix demo i react-color-a11y@latest | |
- name: Set Github identity | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "github-actions-bot" | |
- name: Deploy to Github Pages | |
run: | | |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
pnpm deploy-demo -- -u "github-actions-bot <[email protected]>" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |