From e41d593e1514fff9602a4f992e258208a69a8619 Mon Sep 17 00:00:00 2001 From: Dragan Filipovic Date: Sat, 17 Apr 2021 00:06:00 +0200 Subject: [PATCH 1/4] 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 }}" From 9483c83d88461ed17f3eab948db7b3f1d75e53c7 Mon Sep 17 00:00:00 2001 From: Dragan Filipovic Date: Sat, 17 Apr 2021 00:08:19 +0200 Subject: [PATCH 2/4] CI fix input vars --- .github/workflows/version-bump-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/version-bump-publish.yml b/.github/workflows/version-bump-publish.yml index 1fac39c..f16cdd7 100644 --- a/.github/workflows/version-bump-publish.yml +++ b/.github/workflows/version-bump-publish.yml @@ -22,6 +22,6 @@ jobs: - name: bump and pub if: ${{ github.event.inputs.tag != '' }} run: | - npm version ${{ github.event.inputs.level }} + npm version ${{ github.event.inputs.tag }} git push - git tag -a v${{ github.event.inputs.level }} -m "v${{ github.event.inputs.level }}" + git tag -a v${{ github.event.inputs.tag }} -m "v${{ github.event.inputs.tag }}" From a04c641775c4e81da7d6373ffbde1d87f6b7fc5b Mon Sep 17 00:00:00 2001 From: Dragan Filipovic Date: Sat, 17 Apr 2021 00:12:22 +0200 Subject: [PATCH 3/4] CI - add steps names --- .github/workflows/version-bump-publish.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/version-bump-publish.yml b/.github/workflows/version-bump-publish.yml index f16cdd7..62fe5fa 100644 --- a/.github/workflows/version-bump-publish.yml +++ b/.github/workflows/version-bump-publish.yml @@ -1,4 +1,4 @@ -name: version-bump-publish +name: Manage veresion on: workflow_dispatch: inputs: @@ -11,15 +11,17 @@ jobs: name: checkout runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Setup NodeJS and run build + uses: actions/setup-node@v1 with: node-version: 12 - run: | npm install npm run lint npm run build - - name: bump and pub + - name: Setup version and git tag if: ${{ github.event.inputs.tag != '' }} run: | npm version ${{ github.event.inputs.tag }} From ec4a00fe0259c37b0bec58f433a31e353363e4ed Mon Sep 17 00:00:00 2001 From: Dragan Filipovic Date: Sat, 17 Apr 2021 00:17:27 +0200 Subject: [PATCH 4/4] CI - typo fix --- .github/workflows/version-bump-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version-bump-publish.yml b/.github/workflows/version-bump-publish.yml index 62fe5fa..a5f3cb0 100644 --- a/.github/workflows/version-bump-publish.yml +++ b/.github/workflows/version-bump-publish.yml @@ -1,4 +1,4 @@ -name: Manage veresion +name: Manage version on: workflow_dispatch: inputs: