Skip to content

update demo page layout #4

update demo page layout

update demo page layout #4

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Version type"
required: true
default: "patch"
type: choice
options:
- patch
- minor
- major
- prerelease
tag:
description: "Prerelease tag (if prerelease)"
required: false
default: "beta"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Configure Git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Build library
run: npm run build:lib
- name: Bump version
id: version
run: |
if [ "${{ github.event.inputs.version }}" = "prerelease" ]; then
NEW_VERSION=$(npm version prerelease --preid=${{ github.event.inputs.tag }} --no-git-tag-version)
else
NEW_VERSION=$(npm version ${{ github.event.inputs.version }} --no-git-tag-version)
fi
# Remove the 'v' prefix that npm version adds
NEW_VERSION=${NEW_VERSION#v}
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "VERSION_TAG=v$NEW_VERSION" >> $GITHUB_OUTPUT
echo "🔖 New version: $NEW_VERSION"
- name: Update changelog
run: |
echo "# Changelog" > TEMP_CHANGELOG.md
echo "" >> TEMP_CHANGELOG.md
echo "## ${{ steps.version.outputs.NEW_VERSION }} - $(date +%Y-%m-%d)" >> TEMP_CHANGELOG.md
echo "" >> TEMP_CHANGELOG.md
echo "### Added" >> TEMP_CHANGELOG.md
echo "- New features and improvements" >> TEMP_CHANGELOG.md
echo "" >> TEMP_CHANGELOG.md
if [ -f CHANGELOG.md ]; then
tail -n +2 CHANGELOG.md >> TEMP_CHANGELOG.md
fi
mv TEMP_CHANGELOG.md CHANGELOG.md
- name: Commit and push changes
run: |
git add package.json CHANGELOG.md
git commit -m "chore: release ${{ steps.version.outputs.NEW_VERSION }}"
git tag ${{ steps.version.outputs.VERSION_TAG }}
git push origin main --tags
- name: Publish to NPM
run: |
if [[ "${{ steps.version.outputs.NEW_VERSION }}" == *"beta"* ]] || [[ "${{ steps.version.outputs.NEW_VERSION }}" == *"alpha"* ]] || [[ "${{ steps.version.outputs.NEW_VERSION }}" == *"rc"* ]]; then
npm publish --tag beta
else
npm publish --tag latest
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
run: |
PRERELEASE=""
if [[ "${{ steps.version.outputs.NEW_VERSION }}" == *"beta"* ]] || [[ "${{ steps.version.outputs.NEW_VERSION }}" == *"alpha"* ]] || [[ "${{ steps.version.outputs.NEW_VERSION }}" == *"rc"* ]]; then
PRERELEASE="--prerelease"
fi
gh release create "${{ steps.version.outputs.VERSION_TAG }}" \
--title "Release ${{ steps.version.outputs.NEW_VERSION }}" \
--notes "## What's Changed
Release ${{ steps.version.outputs.NEW_VERSION }}

Check failure on line 107 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

You have an error in your yaml syntax on line 107
### Features & Improvements
- 🎨 Modern React color picker with TypeScript support
- 🌈 8-digit HEX alpha support (#RRGGBBAA)
- 🎯 Multiple color formats (HEX, RGB, HSV, HSL)
- 📱 Touch-friendly mobile interface
- ♿ Accessibility features
## Installation
\`\`\`bash
npm install react-color-pikr@${{ steps.version.outputs.NEW_VERSION }}
\`\`\`
**Full Changelog**: https://github.com/${{ github.repository }}/commits/${{ steps.version.outputs.VERSION_TAG }}" \
$PRERELEASE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}