Skip to content

Commit

Permalink
Merge pull request #8 from anbuksv/master
Browse files Browse the repository at this point in the history
Merge from upstream
  • Loading branch information
swarkentin authored Jan 13, 2022
2 parents 67263ac + f9e6fb1 commit 01856a0
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 7 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/Avantation-Build-Manual-Test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Avantation Package Build Test

on: workflow_dispatch

jobs:
Avantation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Install oclif-dev
run: npm install -g @oclif/dev-cli

- name: Testing
run: npm run test

- name: Package metadata
id: metadata
run: |
set -x
sudo apt-get install jq
export PACKAGE_VERSION=$(cat package.json | jq -r .version)
export PACKAGE_NAME="avantation-v${PACKAGE_VERSION}"
export PACKAGE_LIST="./dist/${PACKAGE_NAME}/*"
echo "::set-output name=package-version::${PACKAGE_VERSION}"
echo "::set-output name=package-name::${PACKAGE_NAME}"
echo "::set-output name=package-dir::${PACKAGE_LIST}"
- name: Package Build
run: |
oclif-dev pack --root avantation
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# tag_name: tv1.0.0 #${{ github.ref }}
# release_name: Release tv1.0.0 #${{ github.ref }}
# body_path: Hello world #${{ steps.changelog.outputs.path }}
# draft: false

- name: Release package to Github #ref: https://hub.github.com/hub-release.1.html
id: upload-plugin-asset
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
set -x
assets=()
export DIR="${{ steps.metadata.outputs.package-dir }}"
for asset in $DIR; do
assets+=("-a" "$asset")
done
tag_name="tv1.0.0" #"${GITHUB_REF##*/}"
hub release create "${assets[@]}" -d -m "$tag_name" "v${{ steps.metadata.outputs.package-name }}"
16 changes: 16 additions & 0 deletions .github/workflows/manual_release_npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Manual Release Package to NPM
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/release_github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Create Github Release

on:
push:
tags:
- 'v*.*.*'

jobs:
Avantation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Install oclif-dev
run: npm install -g @oclif/dev-cli

- name: Testing
run: npm run test

- name: Package metadata
id: metadata
run: |
set -x
sudo apt-get install jq
export PACKAGE_VERSION=$(cat package.json | jq -r .version)
export PACKAGE_NAME="avantation-v${PACKAGE_VERSION}"
export PACKAGE_LIST="./dist/${PACKAGE_NAME}/*"
echo "::set-output name=package-version::${PACKAGE_VERSION}"
echo "::set-output name=package-name::${PACKAGE_NAME}"
echo "::set-output name=package-dir::${PACKAGE_LIST}"
- name: Package Build
run: oclif-dev pack

- name: Release package to Github #ref: https://hub.github.com/hub-release.1.html
id: upload-plugin-asset
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
set -x
assets=()
export DIR="${{ steps.metadata.outputs.package-dir }}"
for asset in $DIR; do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}" #${{ github.ref }}
hub release create "${assets[@]}" -m "$tag_name" "${{ steps.metadata.outputs.package-name }}"
18 changes: 18 additions & 0 deletions .github/workflows/release_npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release Package to NPM
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</a>
</p>

avantation is tool the for generate OpenAPI3.0 from HTTP Archive format(HAR).
avantation is a tool to generate an OpenAPI 3.0 specification from HTTP Archive format(HAR).

avantation is written and maintained by Anbarasan K (anbuksv@gmail.com).

Expand Down
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "avantation",
"description": "Build OpenAPI3.0 specification from HAR",
"version": "2.0.4",
"version": "2.0.5",
"author": "Anbarasan K <anbuksv@gmail.com> (https://www.avantation.in)",
"bin": {
"avantation": "./bin/run"
Expand Down Expand Up @@ -45,7 +45,7 @@
"REST",
"REST API'S",
"API",
"OpenAPI Sepecification",
"OpenAPI Specification",
"OAS",
"Swagger",
"HAR",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Avantation extends Command {
description: 'Write output result in JSON format.'
}),
'disable-tag': flags.boolean({
description: 'Diable end points grouping based on route path in HAR'
description: 'Disable end points grouping based on route path in HAR'
}),
'security-headers': flags.string({
char: 's',
Expand All @@ -73,7 +73,7 @@ class Avantation extends Command {
}),
'http-snippet': flags.boolean({
description:
"Generate HTTP smaple code snippet for request and appedn it as 'x-code-sample' to OpenAPI path object.",
"Generate HTTP sample code snippet for request and append it as 'x-code-sample' to OpenAPI path object.",
default: false
})
};
Expand Down

0 comments on commit 01856a0

Please sign in to comment.