Skip to content

Commit

Permalink
Merge pull request #4 from citkane/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
citkane committed Aug 23, 2022
2 parents fd0bf91 + 811a8fb commit 519a117
Show file tree
Hide file tree
Showing 21 changed files with 2,649 additions and 501 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
indent_style = tab
indent_size = 4
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
node_modules
docs
.nyc*
25 changes: 25 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"root": true,
"parserOptions": {
"sourceType": "module"
},
"env": {
"browser": true,
"es6": true
},
"extends": ["eslint:recommended", "prettier"],
"overrides": [
{
"files": ["**/*.{ts,tsx}"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"env": {
"node": true
}
}
]
}
165 changes: 80 additions & 85 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,85 @@
name: PUBLISH DOCS
on:
workflow_dispatch:
workflow_call:
# or set up your own custom triggers
workflow_dispatch:
workflow_call:
# or set up your own custom triggers
permissions:
contents: write # allows the 'Commit' step without tokens
contents: write # allows the 'Commit' step without tokens

jobs:
get_history: # create an artifact from the existing documentation builds
runs-on: ubuntu-latest
steps:

- name: get the gh-pages repo
uses: actions/checkout@v3
with:
ref: gh-pages

- name: tar the existing docs
run: |
mkdir -p ./docs
tar -cvf documentation.tar ./docs
- name: create a document artifact
uses: actions/upload-artifact@v3
with:
name: documentation
path: documentation.tar

build: # builds the distribution and then the documentation
needs: get_history
runs-on: ubuntu-latest
steps:

- name: Checkout src
uses: actions/checkout@v3

- run: mkdir -p ./docs
- name: Download the existing documents artifact
uses: actions/download-artifact@v3
with:
name: documentation
- run: tar -xf documentation.tar ./docs -C ./docs

- name: Build
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- run: npm ci
- run: npm run build # set up 'build' script in your package.json

- name: Build documents
run: npm run docs #set up 'docs' build script in your package.json


- name: tar the new docs
run: tar -cvf newdocumentation.tar ./docs

- name: create a new document artifact
uses: actions/upload-artifact@v3
with:
name: newdocumentation
path: newdocumentation.tar

commit: # commit the old and new merged documents to gh-pages/docs
needs: build
runs-on: ubuntu-latest
steps:

- name: checkout the gh-pages repo
uses: actions/checkout@v3
with:
ref: gh-pages

- run: mkdir -p ./docs
- name: Download the new documents artifact
uses: actions/download-artifact@v3
with:
name: newdocumentation
- run: tar -xf newdocumentation.tar ./docs -C ./docs

- name: commit
run: |
git config --global user.email "username@users.noreply.github.com"
git config --global user.name "Continuous Integration"
git add .
git commit -m "CI updated the documentation"
git push
get_history: # create an artifact from the existing documentation builds
runs-on: ubuntu-latest
steps:
- name: get the gh-pages repo
uses: actions/checkout@v3
with:
ref: gh-pages

- name: tar the existing docs
run: |
mkdir -p ./docs
tar -cvf documentation.tar ./docs
- name: create a document artifact
uses: actions/upload-artifact@v3
with:
name: documentation
path: documentation.tar

build: # builds the distribution and then the documentation
needs: get_history
runs-on: ubuntu-latest
steps:
- name: Checkout src
uses: actions/checkout@v3

- run: mkdir -p ./docs
- name: Download the existing documents artifact
uses: actions/download-artifact@v3
with:
name: documentation
- run: tar -xf documentation.tar ./docs -C ./docs

- name: Build
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- run: npm ci
- run: npm run build # set up 'build' script in your package.json

- name: Build documents
run: npm run docs #set up 'docs' build script in your package.json

- name: tar the new docs
run: tar -cvf newdocumentation.tar ./docs

- name: create a new document artifact
uses: actions/upload-artifact@v3
with:
name: newdocumentation
path: newdocumentation.tar

commit: # commit the old and new merged documents to gh-pages/docs
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout the gh-pages repo
uses: actions/checkout@v3
with:
ref: gh-pages

- run: mkdir -p ./docs
- name: Download the new documents artifact
uses: actions/download-artifact@v3
with:
name: newdocumentation
- run: tar -xf newdocumentation.tar ./docs -C ./docs

- name: commit
run: |
git config --global user.email "username@users.noreply.github.com"
git config --global user.name "Continuous Integration"
git add .
git commit -m "CI updated the documentation"
git push
124 changes: 61 additions & 63 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,75 @@
name: RELEASE AND PUBLISH
on:
workflow_dispatch:
workflow_dispatch:
jobs:
test:
uses: ./.github/workflows/test.yml
test:
uses: ./.github/workflows/test.yml

upload_coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: coverage
upload_coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: coverage

- uses: codecov/codecov-action@v3
with:
files: ./clover.xml
- uses: codecov/codecov-action@v3
with:
files: ./clover.xml

release:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir -p ./dist
release:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir -p ./dist

- name: Download the build artifact
uses: actions/download-artifact@v3
with:
name: distribution
path: ./dist

- name: Package the build artifact
run: npm pack ./dist
- name: Download the build artifact
uses: actions/download-artifact@v3
with:
name: distribution
path: ./dist

- name: Get Package Version
run: |
echo "RELEASE_NAME=$(npm info ./ version)" >> $GITHUB_ENV
- name: Package the build artifact
run: npm pack ./dist

- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
generate_release_notes: true
tag_name: ${{ env.RELEASE_NAME }}
files: typedoc-plugin-versions-*.tgz
- name: Get Package Version
run: |
echo "RELEASE_NAME=$(npm info ./ version)" >> $GITHUB_ENV
publish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir -p ./dist
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
generate_release_notes: true
tag_name: ${{ env.RELEASE_NAME }}
files: typedoc-plugin-versions-*.tgz

- name: Download the build artifact
uses: actions/download-artifact@v3
with:
name: distribution
path: ./dist
publish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir -p ./dist

- name: Publish to npm
uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish ./dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Download the build artifact
uses: actions/download-artifact@v3
with:
name: distribution
path: ./dist

document:
needs: release
uses: ./.github/workflows/docs.yml

- name: Publish to npm
uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish ./dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

document:
needs: release
uses: ./.github/workflows/docs.yml

0 comments on commit 519a117

Please sign in to comment.