3.0.0-next.10 #13
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 Meteocons | |
| on: | |
| release: | |
| types: [ prereleased, released ] | |
| env: | |
| RELEASE_VERSION: ${{ github.event.release.tag_name }} | |
| permissions: | |
| contents: read | |
| deployments: write | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| name: 🚀 Publish to Registry | |
| steps: | |
| - name: 👀 Checkout | |
| uses: actions/checkout@v6 | |
| - name: 🍞 Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '25' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: ✏️ Tag v${{ env.RELEASE_VERSION }} | |
| run: | | |
| sed -i 's/0.0.0/${{ env.RELEASE_VERSION }}/g' packages/*/package.json | |
| sed -i 's/0.0.0/${{ env.RELEASE_VERSION }}/g' packages/docs/src/pages/docs/cdn.mdx packages/docs/src/pages/docs/getting-started.mdx | |
| sed -i 's/workspace:\*/${{ env.RELEASE_VERSION }}/g' packages/*/package.json | |
| - name: 📦️ Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: 🗂️ Restore Figma cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: packages/exporter/.cache | |
| key: figma-cache-${{ secrets.FIGMA_FILE_KEY }} | |
| - name: 🎨 Fetch SVGs from Figma | |
| run: bun run fetch | |
| env: | |
| FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }} | |
| FIGMA_FILE_KEY: ${{ secrets.FIGMA_FILE_KEY }} | |
| - name: 🔄 Export icons | |
| run: bun run export | |
| - name: 📋 Publish to packages | |
| run: bun run publish-icons | |
| - name: 📤 Upload to CDN | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} | |
| AWS_DEFAULT_REGION: auto | |
| AWS_ENDPOINT_URL: https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com | |
| run: | | |
| mkdir -p cdn-staging/${{ env.RELEASE_VERSION }}/svg | |
| mkdir -p cdn-staging/${{ env.RELEASE_VERSION }}/svg-static | |
| mkdir -p cdn-staging/${{ env.RELEASE_VERSION }}/lottie | |
| for style in fill flat line monochrome; do | |
| cp -r packages/svg/$style cdn-staging/${{ env.RELEASE_VERSION }}/svg/ | |
| cp -r packages/svg-static/$style cdn-staging/${{ env.RELEASE_VERSION }}/svg-static/ | |
| cp -r packages/lottie/$style cdn-staging/${{ env.RELEASE_VERSION }}/lottie/ | |
| done | |
| aws s3 sync cdn-staging/${{ env.RELEASE_VERSION }}/ \ | |
| s3://meteocons/${{ env.RELEASE_VERSION }}/ \ | |
| --no-progress | |
| - name: 🔨 Build docs | |
| run: bun --filter @meteocons/docs build | |
| - name: 🚀 Publish v${{ env.RELEASE_VERSION }} (Pre-release) | |
| if: ${{ github.event.release.prerelease }} | |
| run: | | |
| (cd packages/svg && npm publish --access public --tag next) | |
| (cd packages/svg-static && npm publish --access public --tag next) | |
| (cd packages/lottie && npm publish --access public --tag next) | |
| (cd packages/meteocons && npm publish --access public --tag next) | |
| - name: 🚀 Publish v${{ env.RELEASE_VERSION }} | |
| if: ${{ !github.event.release.prerelease }} | |
| run: | | |
| (cd packages/svg && npm publish --access public) | |
| (cd packages/svg-static && npm publish --access public) | |
| (cd packages/lottie && npm publish --access public) | |
| (cd packages/meteocons && npm publish --access public) | |
| - name: 🚀 Deploy Docs | |
| id: deploy | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| wranglerVersion: "4.69.0" | |
| - name: ⭐️ Output | |
| run: | | |
| echo "Deployed on ${{ steps.deploy.outputs.deployment-url }}" |