File tree Expand file tree Collapse file tree 5 files changed +319
-70
lines changed Expand file tree Collapse file tree 5 files changed +319
-70
lines changed Original file line number Diff line number Diff line change 1+ name : " Generate CSS files and publish to NPM" 
2+ on :
3+   push :
4+     tags :
5+       - ' v*' 
6+   workflow_dispatch :
7+ jobs :
8+   publish :
9+     runs-on : ubuntu-latest 
10+     steps :
11+       - name : Checkout latest 
12+         uses : actions/checkout@v3 
13+       - name : Setup Node 
14+         uses : actions/setup-node@v3 
15+         with :
16+           node-version : ' 18' 
17+           registry-url : ' https://registry.npmjs.org' 
18+       - name : Install dependencies 
19+         run : npm clean-install 
20+       - name : Generate CSS files 
21+         run : npm run generate 
22+       - name : Upload artifact 
23+         uses : actions/upload-artifact@v3 
24+         with :
25+           name : octicons-css 
26+           path : octicons/ 
27+       - name : Publish to NPM 
28+         run : npm publish 
29+         env :
30+           NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }} 
31+       - name : Prepare release 
32+         run : tar -zcvf octicons.tar.gz octicons 
33+       - name : Create release 
34+         uses : softprops/action-gh-release@v1 
35+         if : startsWith(github.ref, 'refs/tags/') 
36+         with :
37+           files : octicons.tar.gz 
38+       - name : Clean up generated files 
39+         run : npm run clean 
Original file line number Diff line number Diff line change 1+ # ## Project Build template
2+ octicons /
3+ octicons.tar.gz 
4+ 
15# ## VisualStudioCode template
26.vscode /* 
37! .vscode /settings.json 
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ async function organizeIcons(...sizes) {
108108
109109async  function  generateCSS ( ...sizes )  { 
110110    await  Promise . all ( 
111-         sizes . map ( async  size  =>  fs . mkdir ( `./dist /octicons-${ size }  ,  { recursive : true } ) ) 
111+         sizes . map ( async  size  =>  fs . mkdir ( `./octicons /octicons-${ size }  ,  { recursive : true } ) ) 
112112    ) ; 
113113    console . info ( "Generating CSS stylesheets..." ) ; 
114114    const  options  =  { hideCursor : true ,  format : "{bar} {percentage}% | ETA: {eta}s | {value}/{total}" } ; 
@@ -117,7 +117,7 @@ async function generateCSS(...sizes) {
117117    await  Promise . all ( 
118118        sizes . map ( async  size  =>  { 
119119            const  inRoot  =  `./icons/${ size }  ; 
120-             const  outRoot  =  `./dist /octicons-${ size }  ; 
120+             const  outRoot  =  `./octicons /octicons-${ size }  ; 
121121            const  fontRoot  =  `${ outRoot }  ; 
122122            const  options  =  { 
123123                inputDir : inRoot , 
@@ -138,7 +138,7 @@ async function generateCSS(...sizes) {
138138
139139Promise . resolve ( ) 
140140    . then ( ( )  =>  setup ( ) ) 
141-     . then ( ( )  =>  cleanup ( "dist " ,  "icons" ) ) 
141+     . then ( ( )  =>  cleanup ( "octicons " ,  "icons" ) ) 
142142    . then ( ( )  =>  downloadIcons ( ) ) 
143143    . then ( ( )  =>  organizeIcons ( 12 ,  16 ,  24 ) ) 
144144    . then ( ( )  =>  generateCSS ( 12 ,  16 ,  24 ) ) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments