Update github action and markdown #66
Workflow file for this run
This file contains hidden or 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: Release Web Platform | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| release-web: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.PELAGORNIS }} | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Get version | |
| id: get_version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Update web package versions | |
| run: | | |
| VERSION="${{ steps.get_version.outputs.version }}" | |
| # Update web package versions | |
| sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" packages/react-icons/package.json | |
| sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" packages/web-icons/package.json | |
| sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" packages/icon-cdn/package.json | |
| echo "✅ Updated all web package versions to $VERSION" | |
| - name: Commit and Push version changes | |
| run: | | |
| echo "Committing and pushing version changes..." | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git config --local init.defaultBranch main | |
| # Make our changes | |
| git add packages/react-icons/package.json packages/web-icons/package.json packages/icon-cdn/package.json | |
| git status | |
| git diff --cached | |
| # Commit changes | |
| git commit -m "chore(web): bump package versions to ${{ steps.get_version.outputs.version }} | |
| - Update packages/react-icons/package.json version | |
| - Update packages/web-icons/package.json version | |
| - Update packages/icon-cdn/package.json version | |
| - Triggered by tag: ${{ github.ref }} | |
| - Workflow: ${{ github.workflow }} | |
| - Commit: ${{ github.sha }}" | |
| # Try to push, if fails, pull and retry | |
| for i in {1..3}; do | |
| if git push origin HEAD:main; then | |
| echo "✅ Successfully pushed version changes" | |
| break | |
| else | |
| echo "Push failed, attempt $i/3. Pulling latest changes..." | |
| git pull origin main --rebase | |
| sleep 2 | |
| fi | |
| done | |
| - name: Build web platform | |
| run: | | |
| npm run generate:metadata | |
| npm run generate:web-icons | |
| npm run generate:fonts | |
| npm run build:fonts | |
| - name: Build icon-cdn | |
| run: | | |
| cd packages/icon-cdn | |
| npm run build | |
| - name: Publish React Icons to npm | |
| run: | | |
| cd packages/react-icons | |
| npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | |
| - name: Publish Web Icons to npm | |
| run: | | |
| cd packages/web-icons | |
| npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | |
| - name: Publish Icon CDN to npm | |
| run: | | |
| cd packages/icon-cdn | |
| npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | |
| - name: Create Web Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.version }} | |
| body: | | |
| ## 🎉 Web Platform Release ${{ steps.get_version.outputs.version }} | |
| ### 📦 NPM Packages | |
| ```bash | |
| npm install @refineui/react-icons@${{ steps.get_version.outputs.version }} | |
| npm install @refineui/web-icons@${{ steps.get_version.outputs.version }} | |
| npm install @refineui/icon-cdn@${{ steps.get_version.outputs.version }} | |
| ``` | |
| ### 🌐 Features | |
| - React components with TypeScript support | |
| - Web icons with font-based system | |
| - 434+ icons with multiple sizes and styles | |
| - Tree-shakable imports | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PELAGORNIS }} |