Skip to content

Commit

Permalink
Use font from here
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnuk committed Jul 24, 2024
1 parent 1add741 commit 139ea5e
Show file tree
Hide file tree
Showing 7 changed files with 761 additions and 13 deletions.
46 changes: 39 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,65 @@
name: Node CI

on: [push]
on:
push:
tags:
- "*"
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 18
- 20
- 22.4
steps:
- uses: actions/checkout@v4
- name: Use Node.js 16.x
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 16.x
- name: npm ci, check, test
node-version: ${{ matrix.node-version }}
- name: node check
run: |
npm ci
npm run lint
npm run build
npm test
env:
CI: true
status-checks:
name: status-checks
needs: [build]
permissions:
contents: none
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Validation Status checks
run: |
echo 'Configuration for Status checks that are required'
echo '${{ toJSON(needs) }}'
if [[ ('skipped' == '${{ needs.build.result }}') || ('success' == '${{ needs.build.result }}') ]]; then
exit 0
fi
exit 1
deploy:
if: startsWith(github.event.ref, 'refs/tags/')
needs: build
needs: ["status-checks"]
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Use Node.js 16.x
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: 'npm'
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- name: deploy
run: |
Expand All @@ -38,6 +69,7 @@ jobs:
if [ "$PACKAGE_VERSION" != "$GITHUB_REF_NAME" ]; then echo "$PACKAGE_VERSION and $GITHUB_REF_NAME are not the same, skipping"; exit 1; fi
echo "Publishing $PACKAGE_VERSION …"
npm ci
npm run build
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.idea/
/node_modules
/src/documentation/lib/
23 changes: 23 additions & 0 deletions build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import fs from 'fs';
import path from 'path';


const DIST_LIB = path.resolve(__dirname, 'src', 'documentation', 'lib');
const FONT = '@fontsource/montserrat';
const MODULE_FONT = path.dirname(require.resolve(`${FONT}/package.json`));
const DIST_LIB_FONT = path.resolve(DIST_LIB, FONT);


const fontCopy = (file: string) => fs.cpSync(path.resolve(MODULE_FONT, file), path.resolve(DIST_LIB_FONT, file), {recursive: true});
const fontCopyFiles = (...files: string[]) => files.forEach(fontCopy);

console.log(`Reset dist lib folder at ${DIST_LIB}`);

fs.rmSync(DIST_LIB, {recursive: true, force: true});
fs.mkdirSync(DIST_LIB, {recursive: true});

console.log(`Move font files from ${MODULE_FONT} to ${DIST_LIB_FONT}`);

fontCopyFiles('files', 'index.css', '700.css');

console.log('Done');
Loading

0 comments on commit 139ea5e

Please sign in to comment.