From e41d593e1514fff9602a4f992e258208a69a8619 Mon Sep 17 00:00:00 2001 From: Dragan Filipovic Date: Sat, 17 Apr 2021 00:06:00 +0200 Subject: [PATCH] CI add actions for build and tag --- .github/workflows/build.yml | 27 ++++++++++++++++++++++ .github/workflows/version-bump-publish.yml | 27 ++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/version-bump-publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ff4fd3a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +name: Build + +on: + push: + branches: [ '**' ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + node-version: [14.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm i + - run: npm run lint + - run: npm run build diff --git a/.github/workflows/version-bump-publish.yml b/.github/workflows/version-bump-publish.yml new file mode 100644 index 0000000..1fac39c --- /dev/null +++ b/.github/workflows/version-bump-publish.yml @@ -0,0 +1,27 @@ +name: version-bump-publish +on: + workflow_dispatch: + inputs: + tag: + description: ' | major | minor | patch' + required: true + default: 'patch' +jobs: + checkout: + name: checkout + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: | + npm install + npm run lint + npm run build + - name: bump and pub + if: ${{ github.event.inputs.tag != '' }} + run: | + npm version ${{ github.event.inputs.level }} + git push + git tag -a v${{ github.event.inputs.level }} -m "v${{ github.event.inputs.level }}"