From 1642fa61d1c36ceed2c33927087557d9b4db30fb Mon Sep 17 00:00:00 2001 From: Devil7DK Date: Sun, 13 Feb 2022 00:46:38 +0530 Subject: [PATCH] build: Add workflows for building & publishing package --- .github/workflows/build.yml | 22 ++++++++++++++++++++++ .github/workflows/publish.yml | 21 +++++++++++++++++++++ .vscode/settings.json | 15 +++++++++------ 3 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..80a1417 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: build + +on: + push: + branches: + - master + paths: + - 'src/**' + - 'package.json' + - 'tsconfig.json' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 14 + - run: yarn install + - run: yarn build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a576111 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: publish + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 14 + - run: yarn install + - run: yarn build + - uses: JS-DevTools/npm-publish@v1 + with: + access: 'public' + token: ${{ secrets.NPM_TOKEN }} diff --git a/.vscode/settings.json b/.vscode/settings.json index 82f84b8..877ce52 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,10 @@ { - "editor.codeActionsOnSave": { - "source.fixAll": true - }, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true, -} \ No newline at end of file + "editor.codeActionsOnSave": { + "source.fixAll": true + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "yaml.schemas": { + "https://json.schemastore.org/github-workflow.json": "file:///home/devil7dk/Projects/eslint-plugin-swagger/.github/workflows/build.yml" + } +}