Build #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Delete Node Modules | |
run: rm -rf packages/icons-webfont/node_modules | |
- name: Deploy | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: wf-dist | |
FOLDER: packages/icons-webfont | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: '[Tag] Chekout' | |
uses: actions/checkout@v4 | |
with: | |
ref: wf-dist | |
fetch-depth: 0 | |
- name: Tag on Dist Branch | |
run: | | |
git tag $(jq -r ".version" package.json) | |
git push origin wf-dist --tags |