From 555662be4bdc9fddcf35d11402ef91d725a2a5d3 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Mon, 19 Aug 2019 14:47:32 +0100 Subject: [PATCH 1/2] build: Use GitHub Actions for CI/CD --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c2676d1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: Chai HTTP + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build: + name: Test on node ${{ matrix.node_version }} + runs-on: ubuntu-latest + strategy: + matrix: + node_version: + - 8 # to be removed 2020-01 + - 10 # to be removed 2021-01 + - x.x.x # safety net; don't remove + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node_version }} + - run: npm run env + - run: npm i -g npm@6 && npm ci + - run: npm test + - uses: coverallsapp/github-action@v1.0.1 + with: + github-token: ${{ secrets.github_token }} + + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm run release + if: github.event == 'push' + env: + NPM_TOKEN: ${{secrets.NPM_TOKEN}} From 1e3864165736e14ce9b2d8fb9565f70f94654e5e Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Tue, 20 Aug 2019 10:28:18 +0100 Subject: [PATCH 2/2] build: add github token to publish step Co-Authored-By: Austin Cawley-Edwards --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2676d1..0cd4451 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,3 +44,4 @@ jobs: if: github.event == 'push' env: NPM_TOKEN: ${{secrets.NPM_TOKEN}} + GITHUB_TOKEN: ${{secrets.github_token}}