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 613ed7c commit bd747e2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 16 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
33 changes: 33 additions & 0 deletions .github/workflows/publish-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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}}
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit bd747e2

Please sign in to comment.