Skip to content

Commit

Permalink
Merge pull request #403 from EXXETA/398-publish-mock-server
Browse files Browse the repository at this point in the history
Publish openapi-mock-server independently
  • Loading branch information
LexLuengas authored Dec 9, 2022
2 parents 88d5e41 + 156f8b6 commit 3e6a115
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
build
mock-server/node_modules
mock-server/build
mock-server
.idea
.vscode
6 changes: 1 addition & 5 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies & build (mock)
working-directory: ./mock-server
run: npm ci

- name: Install dependencies & build (proxy)
- name: Install dependencies & build
run: npm ci

- name: Test
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/publish-npm-package-mock-server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish openapi-mock-server Node.js package

on:
workflow_dispatch:

env:
NODE_VERSION: '10.x'

jobs:
publish-to-npmjs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./mock-server
steps:
- uses: actions/checkout@v3
- name: Set up publishing to npmjs.com
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run compile
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
publish-to-github-packages:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./mock-server
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up publishing to GitHub Packages
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://npm.pkg.github.com'
scope: '@exxeta'
- run: npm ci
- run: npm run compile
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 13 additions & 3 deletions mock-server/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
{
"name": "openapi-cop-mock-server",
"name": "@exxeta/openapi-cop-mock-server",
"version": "1.0.0",
"description": "Mock server for use together with the openapi-cop proxy server",
"description": "Mock server used to test openapi-cop proxy server.",
"license": "MIT",
"author": "Alexis Luengas",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/EXXETA/openapi-cop.git"
},
"engines": {
"node": "^10 || ^12"
},
"main": "./build/src/app",
"bin": "./build/src/cli.js",
"types": "./build/src/app.d.ts",
"files": [
"build/"
],
"scripts": {
"postinstall": "npm run compile",
"check": "gts check",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"find-process": "1.4.7",
"gts": "3.1.1",
"mocha": "9.2.2",
"openapi-cop-mock-server": "file:./mock-server",
"openapi-cop-mock-server": "1.0.0",
"typescript": "4.0.5"
}
}

0 comments on commit 3e6a115

Please sign in to comment.