From b9ff3990c733a0a2c1c8c683c8a4f48529e3a9b5 Mon Sep 17 00:00:00 2001 From: Guilherme Diego Date: Fri, 18 Sep 2020 09:33:36 -0300 Subject: [PATCH] change(workflow): put all steps into one workflow --- .github/workflows/deploy.yaml | 26 ------------------- .github/workflows/main.yml | 47 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 30 ---------------------- package.json | 2 +- 4 files changed, 48 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index df3136c..0000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: Deploy -on: - release: - types: [published] - -jobs: - prepare: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: 'starting' - run: echo "start deploy..." - npm: - runs-on: ubuntu-latest - needs: ['prepare', 'Test.quality'] - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 12 - registry-url: https://registry.npmjs.org/ - - run: yarn install - - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} - diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e8f846b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,47 @@ +name: Test, Build and Deploy +on: + release: + types: [published] + push: + branches: '*' + pull_request: + branches: '*' + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install + run: yarn install + + - name: Check TS + run: yarn tsc + + - name: Lint + run: yarn lint + + - name: Test and Deploy Coverage + run: yarn jest --coverage + + - name: Deploy Coverage + uses: coverallsapp/github-action@master + if: github.ref == 'refs/heads/master' + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy: + runs-on: ubuntu-latest + needs: 'quality' + if: github.event.action == 'published' + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: yarn install + - run: yarn build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 703ed27..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Test -on: - push: - branches: '*' - pull_request: - branches: '*' - -jobs: - quality: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install - run: yarn install - - - name: Check TS - run: yarn tsc - - - name: Lint - run: yarn lint - - - name: Test and Deploy Coverage - run: yarn jest --coverage - - - name: Deploy Coverage - uses: coverallsapp/github-action@master - if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true && github.ref == 'refs/heads/master' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 02d2c5a..a4206d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@postgresrest/node", - "version": "1.0.0", + "version": "0.0.1", "main": "dist/index.js", "types": "dist/index.d.js", "repository": "git@github.com:prest/prest-node.git",