diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6b3b94a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: NPM Publish + +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://npm.pkg.github.com' + + - name: Extract commit message + id: extract_message + run: | + COMMIT_MESSAGE=$(git log -1 --pretty=%B) + echo "commit-message=${COMMIT_MESSAGE}" >> $GITHUB_ENV + + - name: Check for version number in commit message + id: check_version + run: | + if [[ "${{ env.commit-message }}" =~ \[filigran-ui\]\s*(v[0-9]+\.[0-9]+\.[0-9]+)?$ ]]; then + echo "package=filigran-ui" >> $GITHUB_ENV + echo "version=true" >> $GITHUB_ENV + elif [[ "${{ env.commit-message }}" =~ \[filigran-icon\]\s*(v[0-9]+\.[0-9]+\.[0-9]+)?$ ]]; then + echo "package=filigran-icon" >> $GITHUB_ENV + echo "version=true" >> $GITHUB_ENV + else + echo "version=false" >> $GITHUB_ENV + fi + + - name: Install dependencies + if: env.version == 'true' + run: npm install + + - name: Publish Filigran UI + if: env.package == 'filigran-ui' + run: npm run publish:filigran-ui + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish Filigran Icon + if: env.package == 'filigran-icon' + run: npm run publish:filigran-icon + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 840c92d..e856f87 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "scripts": { "build": "npm run build --workspaces --if-present", "build:filigran-website": "npm run build -w filigran-website", - "dev": "npm run dev -w filigran-website" + "dev": "npm run dev -w filigran-website", + "publish:filigran-icon": "npm run build --workspace packages/filigran-icon && npm publish --workspace packages/filigran-icon", + "publish:filigran-ui": "npm run build --workspace packages/filigran-ui && npm publish --workspace packages/filigran-ui" }, "private": true, "keywords": [], diff --git a/packages/filigran-icon/src/index.ts b/packages/filigran-icon/src/index.ts index 54ccb9d..e69de29 100644 --- a/packages/filigran-icon/src/index.ts +++ b/packages/filigran-icon/src/index.ts @@ -1,91 +0,0 @@ -import { lazy } from "react"; -export const AddIcon = lazy(() => import("./Add")); -export const AdministrativeAreaIcon = lazy( - () => import("./AdministrativeArea"), -); -export const ArrowRightAltIcon = lazy(() => import("./ArrowRightAlt")); -export const AssignmentIcon = lazy(() => import("./Assignment")); -export const AttackPatternIcon = lazy(() => import("./AttackPattern")); -export const AttributeIcon = lazy(() => import("./Attribute")); -export const Binoculars1Icon = lazy(() => import("./Binoculars1")); -export const CalendarViewMonthIcon = lazy(() => import("./CalendarViewMonth")); -export const CampaignIcon = lazy(() => import("./Campaign")); -export const CaseIncidentIcon = lazy(() => import("./CaseIncident")); -export const CaseRfiIcon = lazy(() => import("./CaseRfi")); -export const CaseRftIcon = lazy(() => import("./CaseRft")); -export const ChannelIcon = lazy(() => import("./Channel")); -export const CheckIcon = lazy(() => import("./Check")); -export const ChecklistRtlIcon = lazy(() => import("./ChecklistRtl")); -export const ChevronIcon = lazy(() => import("./Chevron")); -export const CityIcon = lazy(() => import("./City")); -export const CloseIcon = lazy(() => import("./Close")); -export const ConstructionIcon = lazy(() => import("./Construction")); -export const CountryIcon = lazy(() => import("./Country")); -export const CourseOfActionIcon = lazy(() => import("./CourseOfAction")); -export const DashboardIcon = lazy(() => import("./Dashboard")); -export const DataSourceIcon = lazy(() => import("./DataSource")); -export const DatabaseOutline1Icon = lazy(() => import("./DatabaseOutline1")); -export const DeleteIcon = lazy(() => import("./Delete")); -export const DragHandleIcon = lazy(() => import("./DragHandle")); -export const DragIndicatorIcon = lazy(() => import("./DragIndicator")); -export const EditIcon = lazy(() => import("./Edit")); -export const EventIcon = lazy(() => import("./Event")); -export const ExternalReferenceIcon = lazy(() => import("./ExternalReference")); -export const ForumIcon = lazy(() => import("./Forum")); -export const GlobeLine1Icon = lazy(() => import("./GlobeLine1")); -export const GradeIcon = lazy(() => import("./Grade")); -export const Group5Icon = lazy(() => import("./Group5")); -export const Group6Icon = lazy(() => import("./Group6")); -export const GroupIcon = lazy(() => import("./Group")); -export const GroupingIcon = lazy(() => import("./Grouping")); -export const HomeIcon = lazy(() => import("./Home")); -export const IncidentIcon = lazy(() => import("./Incident")); -export const IndicatorIcon = lazy(() => import("./Indicator")); -export const IndividualIcon = lazy(() => import("./Individual")); -export const InfrastructureIcon = lazy(() => import("./Infrastructure")); -export const IntrusionSetIcon = lazy(() => import("./IntrusionSet")); -export const KeyboardArrowDownIcon = lazy(() => import("./KeyboardArrowDown")); -export const KeyboardArrowLeftIcon = lazy(() => import("./KeyboardArrowLeft")); -export const KeyboardArrowRightIcon = lazy( - () => import("./KeyboardArrowRight"), -); -export const KeyboardArrowUpIcon = lazy(() => import("./KeyboardArrowUp")); -export const KillChainPhaseIcon = lazy(() => import("./KillChainPhase")); -export const LabelIcon = lazy(() => import("./Label")); -export const LanguageIcon = lazy(() => import("./Language")); -export const LayersBlackIcon = lazy(() => import("./LayersBlack")); -export const LittleArrowIcon = lazy(() => import("./LittleArrow")); -export const LogoFiligranIcon = lazy(() => import("./LogoFiligran")); -export const LogoutIcon = lazy(() => import("./Logout")); -export const MalwareAnalysisIcon = lazy(() => import("./MalwareAnalysis")); -export const MalwareIcon = lazy(() => import("./Malware")); -export const MapIcon = lazy(() => import("./Map")); -export const MarkingDefinitionIcon = lazy(() => import("./MarkingDefinition")); -export const NarrativeIcon = lazy(() => import("./Narrative")); -export const NoteIcon = lazy(() => import("./Note")); -export const ObservedDataIcon = lazy(() => import("./ObservedData")); -export const OpinionIcon = lazy(() => import("./Opinion")); -export const OrganizationIcon = lazy(() => import("./Organization")); -export const PolarAreaIcon = lazy(() => import("./PolarArea")); -export const Polygon5Icon = lazy(() => import("./Polygon5")); -export const PositionIcon = lazy(() => import("./Position")); -export const ReadMoreIcon = lazy(() => import("./ReadMore")); -export const RelationshipIcon = lazy(() => import("./Relationship")); -export const ReportIcon = lazy(() => import("./Report")); -export const ScheduleIcon = lazy(() => import("./Schedule")); -export const ScienceIcon = lazy(() => import("./Science")); -export const SectorIcon = lazy(() => import("./Sector")); -export const SettingsIcon = lazy(() => import("./Settings")); -export const SpaceDashboardIcon = lazy(() => import("./SpaceDashboard")); -export const SystemIcon = lazy(() => import("./System")); -export const TaskIcon = lazy(() => import("./Task")); -export const TextSnippetIcon = lazy(() => import("./TextSnippet")); -export const ThreatActorGroupIcon = lazy(() => import("./ThreatActorGroup")); -export const ThreatActorIndividualIcon = lazy( - () => import("./ThreatActorIndividual"), -); -export const ToolIcon = lazy(() => import("./Tool")); -export const UnknownIcon = lazy(() => import("./Unknown")); -export const VulnerabilityIcon = lazy(() => import("./Vulnerability")); -export const WorkEmptyIcon = lazy(() => import("./WorkEmpty")); -export const WorkFullIcon = lazy(() => import("./WorkFull"));