diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e30ee27..2ba9c17 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index 1887064..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -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}} diff --git a/package.json b/package.json index f960935..526e97a 100644 --- a/package.json +++ b/package.json @@ -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"