Skip to content

Commit

Permalink
update workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
tamcy committed Jul 22, 2024
1 parent 69085d3 commit 3978488
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 18 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@ on:
push:
tags:
- 'npm/*'

defaults:
run:
working-directory: WEBFONT
workflow_dispatch:

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: https://registry.npmjs.org/
- run: mv npm-package-readme.md README.md
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-woff2-otf-npm:
uses: ./.github/workflows/publish-base.yml
with:
directory: WOFF2_OTF
secrets: inherit
publish-woff2-ttf_npm:
uses: ./.github/workflows/publish-base.yml
with:
directory: WOFF2_TTF
secrets: inherit
31 changes: 31 additions & 0 deletions .github/workflows/publish-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish woff2 npm package

on:
workflow_call:
secrets:
npm_token:
required: true
inputs:
directory:
description: 'Directory'
type: string
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
${{inputs.directory}}
env:
DIRECTORY: ${{inputs.directory}}
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: https://registry.npmjs.org/
- run: |
mv npm-package-readme.md README.md
npm publish
working-directory: ${{inputs.directory}}
2 changes: 1 addition & 1 deletion WOFF2_OTF/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chiron-hei-hk-webfont",
"version": "2.5.12-alpha.1",
"version": "2.5.12-alpha",
"description": "Webfont version of Chiron Hei HK, a Traditional Chinese typeface.",
"keywords": [
"Traditional Chinese",
Expand Down
2 changes: 1 addition & 1 deletion WOFF2_TTF/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chiron-hei-hk-webfont-ttf",
"version": "2.5.11",
"version": "2.5.12-alpha",
"description": "Webfont version (TTF) of Chiron Hei HK, a Traditional Chinese typeface.",
"keywords": [
"Traditional Chinese",
Expand Down

0 comments on commit 3978488

Please sign in to comment.