Added publish steps
All checks were successful
Build / Build NPM Project (push) Successful in 42s
Build / Tag Version (push) Successful in 4s

This commit is contained in:
Zakary Timson 2023-12-19 23:20:07 -05:00
parent 43b11ab295
commit 8a58160c2e
3 changed files with 40 additions and 29 deletions

View File

@ -23,10 +23,48 @@ jobs:
- name: Test
run: npm run test:coverage
- name: Cache Artifacts
uses: ztimson/actions/cache@develop
with:
pattern: dist
- name: Upload Docs
if: ${{inputs.artifacts}} != "false"
uses: actions/upload-artifact@v3
with:
name: docs
path: docs
retention-days: 7
tag:
name: Tag Version
needs: build
if: ${{github.ref_name}} == 'release'
runs-on: ubuntu-latest
container: node
steps:
- name: Clone Repository
uses: ztimson/actions/clone@develop
- name: Get Version Number
run: echo "VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV
- name: Tag Version
uses: ztimson/actions/tag@develop
with:
tag: ${{env.VERSION}}
publish:
name: Tag Version
needs: build
if: ${{github.ref_name}} == 'release'
runs-on: ubuntu-latest
container: node
steps:
- name: Clone Repository
uses: ztimson/actions/clone@develop
- name: Restore Artifacts
uses: ztimson/actions/cache/restore@develop
- name: Upload to Registry
uses: ztimson/actions/npm/publish@develop

View File

@ -1,27 +0,0 @@
name: Publish
run-name: Publish
on:
workflow_run:
workflows:
- Build
types:
- completed
jobs:
tag:
name: Tag Version
needs: build
runs-on: ubuntu-latest
container: node
steps:
- name: Clone Repository
uses: ztimson/actions/clone@develop
- name: Get Version Number
run: echo "VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV
- name: Tag Version
uses: ztimson/actions/tag@develop
with:
tag: ${{env.VERSION}}

View File

@ -9,7 +9,7 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc && npm run build:docs",
"build:docs": "npx typedoc --readme none --out docs src/index.ts",
"build:docs": "npx typedoc --readme none --plugin typedoc-plugin-markdown --out docs src/index.ts",
"test": "npx jest --verbose",
"test:coverage": "npx jest --verbose --coverage",
"watch": "npm run build && npx tsc --watch"