Skip to content

Build

Build #18

Workflow file for this run

name: Build
on: ['workflow_dispatch']
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- name: Install FontForge
run: sudo apt-get install fontforge
- name: Cache Icons
uses: actions/cache@v4
with:
path: packages/icons-webfont/icons-outlined
key: ${{ runner.os }}-icons-outlined
- name: Get Version
id: version
run: echo "version=$(jq -r ".version |= sub(\"^(?<a>\\\\d+\\\\.\\\\d+\\\\.\\\\d+)(-.*)?$\"; \"\(.a)-mi.$(git log --oneline | wc -l)+$(git rev-parse --short HEAD)\") | .version" package.json)" >> $GITHUB_OUTPUT
- name: Override Version
run: |
cd packages/icons-webfont
jq ".version |= \"${{ steps.version.outputs.version }}\"" package.json > package.json.tmp
mv package.json.tmp package.json
- name: Build
run: 'pnpm build:webfont'
- name: Check Directory
run: ls -la packages/icons-webfont/dist
- name: Delete Node Modules
run: rm -rf packages/icons-webfont/node_modules
- name: Copy Artifact to temp folder
run: cp -r packages/icons-webfont /tmp/icons-webfont
- name: Reset Current Changes
run: |
git reset --hard
git clean -fd
- name: Checkout Dist Branch
uses: actions/checkout@v4
with:
ref: wf-dist
- name: Remove Everything in Dist Branch
run: rm -rf *
- name: Copy Artifact to Dist Branch
run: cp -r /tmp/icons-webfont/* .
- name: Tag on Dist Branch
run: |
git tag $(jq -r ".version" package.json)
git push origin wf-dist --tags