Skip to content

Commit

Permalink
[configurations] add release workflow for publishing npm
Browse files Browse the repository at this point in the history
  • Loading branch information
jpkha committed Jun 13, 2024
1 parent 049f9b1 commit f11e598
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 92 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand Down
91 changes: 0 additions & 91 deletions packages/filigran-icon/src/index.ts
Original file line number Diff line number Diff line change
@@ -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"));

0 comments on commit f11e598

Please sign in to comment.