Compare commits

...
10 changed files with 170 additions and 47 deletions
+5
View File
@@ -30,6 +30,11 @@
- any-glob-to-any-file:
- 'icons/*.svg'
🔬 Lab icon:
- changed-files:
- any-glob-to-any-file:
- 'lab/*.svg'
# For changes in the lucide package
🧳 lucide package:
- changed-files:
+1
View File
@@ -3,6 +3,7 @@ name: Lucide Lab checks
on:
pull_request:
paths:
- lab/**
- packages/lab/**
- packages/shared/**
- tools/build-icons/**
+146
View File
@@ -0,0 +1,146 @@
name: Release @lucide/lab
on:
push:
branches:
- main
paths:
- lab/**/*.svg
workflow_dispatch:
inputs:
release-type:
description: Release type
required: true
default: 'minor'
type: choice
options:
- patch
- minor
- major
permissions: {}
jobs:
create-release:
if: github.repository == 'lucide-icons/lucide'
runs-on: ubuntu-latest
permissions:
contents: write # Required to create the release and tag
outputs:
VERSION: ${{ steps.new-version.outputs.NEW_VERSION }}
SHOULD_RELEASE: ${{ steps.release-notes.outputs.SHOULD_RELEASE }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # Required to diff the lab icons against the previous tag
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
cache: 'pnpm'
node-version-file: 'package.json'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Get latest tag
id: latest-tag
run: |
LATEST_TAG=$(git tag --list '@lucide/lab@*' --sort=-v:refname | head -n 1)
if [ -z "$LATEST_TAG" ]; then
echo "::error::No @lucide/lab@* tag found to release from."
exit 1
fi
echo "Latest tag: $LATEST_TAG"
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Create new version
id: new-version
run: |
NEW_VERSION=$(pnpm semver "${LATEST_TAG#@lucide/lab@}" -i "$RELEASE_TYPE")
echo "New version: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
env:
LATEST_TAG: ${{ steps.latest-tag.outputs.LATEST_TAG }}
RELEASE_TYPE: ${{ inputs.release-type || 'minor' }}
- name: Generate release notes
id: release-notes
run: |
NEW_TAG="@lucide/lab@$NEW_VERSION"
ADDED=$(git diff --name-only --diff-filter=A "$LATEST_TAG" HEAD -- 'lab/*.svg' \
| xargs -r -n1 basename | sed 's/\.svg$//' | sort)
REMOVED=$(git diff --name-only --diff-filter=D "$LATEST_TAG" HEAD -- 'lab/*.svg' \
| xargs -r -n1 basename | sed 's/\.svg$//' | sort)
if [ -z "$ADDED" ] && [ "$EVENT_NAME" != 'workflow_dispatch' ]; then
echo "::notice::No icons were added to ./lab since $LATEST_TAG, skipping release."
echo "SHOULD_RELEASE=false" >> $GITHUB_OUTPUT
exit 0
fi
{
if [ -n "$ADDED" ]; then
printf '## New icons\n\n'
printf '%s\n' "$ADDED" | sed 's|.*|- `&`|'
printf '\n'
fi
if [ -n "$REMOVED" ]; then
printf '## Removed icons\n\nThese graduated to the core icon set.\n\n'
printf '%s\n' "$REMOVED" | sed 's|.*|- `&`|'
printf '\n'
fi
printf '**Full changelog**: https://github.com/lucide-icons/lucide/compare/%s...%s\n' "$LATEST_TAG" "$NEW_TAG"
} > lab-release-notes.md
cat lab-release-notes.md
echo "SHOULD_RELEASE=true" >> $GITHUB_OUTPUT
env:
LATEST_TAG: ${{ steps.latest-tag.outputs.LATEST_TAG }}
NEW_VERSION: ${{ steps.new-version.outputs.NEW_VERSION }}
EVENT_NAME: ${{ github.event_name }}
- name: Create Release
if: steps.release-notes.outputs.SHOULD_RELEASE == 'true'
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
tag_name: '@lucide/lab@${{ steps.new-version.outputs.NEW_VERSION }}'
name: '@lucide/lab@${{ steps.new-version.outputs.NEW_VERSION }}'
body_path: lab-release-notes.md
make_latest: 'false' # Never displace the core icon release as "Latest"
publish:
if: github.repository == 'lucide-icons/lucide' && needs.create-release.outputs.SHOULD_RELEASE == 'true'
runs-on: ubuntu-latest
needs: create-release
permissions:
id-token: write # Required for OIDC (npm provenance)
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
cache: 'pnpm'
node-version-file: 'package.json'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Set new version
run: pnpm version ${{ needs.create-release.outputs.VERSION }} --filter @lucide/lab --fail-if-no-match --no-git-tag-version
- name: Build
run: pnpm --filter @lucide/lab build
- name: Publish
run: pnpm --filter @lucide/lab publish --access public --no-git-checks --ignore-scripts --tag latest
env:
NPM_CONFIG_PROVENANCE: true
+2 -2
View File
@@ -9,6 +9,6 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z" />
<path d="M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12" />
<path d="M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20" />
<path d="M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13" />
</svg>

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 404 B

-20
View File
@@ -1,20 +0,0 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"colebemis",
"csandman",
"ericfennis",
"karsa-mistmere"
],
"use-cases": [],
"tags": [
"garbage",
"delete",
"remove",
"bin"
],
"categories": [
"files",
"mail"
]
}
-17
View File
@@ -1,17 +0,0 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10 11v6" />
<path d="M14 11v6" />
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />
<path d="M3 6h18" />
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
</svg>

Before

Width:  |  Height:  |  Size: 389 B

+7
View File
@@ -26,5 +26,12 @@
"categories": [
"files",
"mail"
],
"aliases": [
{
"name": "trash-2",
"deprecated": true,
"deprecationReason": "alias.duplicate"
}
]
}
+2
View File
@@ -9,6 +9,8 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<path d="M10 11v6" />
<path d="M14 11v6" />
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" />
<path d="M3 6h18" />
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />

Before

Width:  |  Height:  |  Size: 341 B

After

Width:  |  Height:  |  Size: 389 B

+6 -6
View File
@@ -9,13 +9,13 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="4" height="4" x="2" y="3" />
<path d="M6 7v2c0 .6.1 1.4.2 2L8 20.8v.2c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V7" />
<path d="M14 2v7l-2 5v8" />
<rect width="4" height="6" x="10" y="3" />
<path d="M18 6h4" />
<path d="M14 11h-2a2 2 0 01-1.73-3 2 2 0 010-2A2 2 0 0112 3h2" />
<path d="M14 2v9.35a4 4 0 01-.205 1.266l-.59 1.768A4 4 0 0013 15.65V22" />
<path d="M18 10h4" />
<path d="M18 14h4" />
<path d="M18 18h4" />
<path d="M18 2h2a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2" />
<path d="M18 2h2a2 2 0 012 2v16a2 2 0 01-2 2h-2" />
<path d="M18 6h4" />
<path d="M2 3a1 1 0 011-1h2a1 1 0 011 1v6c0 .6.1 1.4.2 2L8 20.8v.2a1 1 0 01-1 1H3a1 1 0 01-1-1z" />
<path d="M2 6h4" />
</svg>

Before

Width:  |  Height:  |  Size: 559 B

After

Width:  |  Height:  |  Size: 626 B

+1 -2
View File
@@ -36,8 +36,7 @@
"build:icons": "build-icons --input=../../lab --output=./src --templateSrc=./scripts/exportTemplate.mts --iconFileExtension=.ts --exportModuleNameCasing=camel --renderUniqueKey --exportFileName=index.ts",
"build:lib": "node ./scripts/buildLib.mts",
"build:bundle": "rollup -c rollup.config.mjs",
"clean": "rm -f src/icons/*.ts && rm -rf dist && rm -rf icons && rm -f icon-nodes.json",
"version": "pnpm version --git-tag-version=false"
"clean": "rm -f src/icons/*.ts && rm -rf dist && rm -rf icons && rm -f icon-nodes.json"
},
"devDependencies": {
"@lucide/build-icons": "workspace:*",