diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 00000000..1f10d1ec --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,69 @@ +name: validate +on: [push, pull_request] +jobs: + main: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + node: [10.13, 12, 14, 15] + runs-on: ${{ matrix.os }} + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v2 + + - name: ⎔ Setup node + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - name: 📥 Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: ▶️ Run validate script + run: npm run validate + + - name: ⬆️ Upload coverage report + uses: codecov/codecov-action@v1 + + release: + needs: main + runs-on: ubuntu-latest + if: + ${{ github.repository == 'kentcdodds/kcd-scripts' && + contains('refs/heads/master,refs/heads/beta,refs/heads/next,refs/heads/alpha', + github.ref) && github.event_name == 'push' }} + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v2 + + - name: ⎔ Setup node + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: 📥 Download deps + uses: bahmutov/npm-install@v1 + with: + useLockFile: false + + - name: 🏗 Run build script + run: npm run build + + - name: 🚀 Release + uses: cycjimmy/semantic-release-action@v2 + with: + semantic_version: 17 + branches: | + [ + '+([0-9])?(.{+([0-9]),x}).x', + 'main', + 'next', + 'next-major', + {name: 'beta', prerelease: true}, + {name: 'alpha', prerelease: true} + ] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8061405f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: node_js -cache: npm -notifications: - email: false -node_js: - - 10.18 - - 12 - - 14 - - node -install: npm install -script: - - npm run validate - - npx codecov@3 -branches: - only: - - master - - next - -jobs: - include: - - stage: release - node_js: 14 - script: node src travis-release - if: fork = false diff --git a/README.md b/README.md index 81dac115..af07be13 100644 --- a/README.md +++ b/README.md @@ -221,8 +221,8 @@ MIT [npm]: https://www.npmjs.com [node]: https://nodejs.org -[build-badge]: https://img.shields.io/travis/com/kentcdodds/kcd-scripts.svg?style=flat-square -[build]: https://travis-ci.com/kentcdodds/kcd-scripts +[build-badge]: https://img.shields.io/github/workflow/status/kentcdodds/kcd-scripts/validate/main?logo=github&style=flat-square +[build]: https://github.com/kentcdodds/kcd-scripts/actions?query=workflow%3Avalidate [coverage-badge]: https://img.shields.io/codecov/c/github/kentcdodds/kcd-scripts.svg?style=flat-square [coverage]: https://codecov.io/github/kentcdodds/kcd-scripts [version-badge]: https://img.shields.io/npm/v/kcd-scripts.svg?style=flat-square diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7151c705..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,15 +0,0 @@ -environment: - matrix: - - node_version: '10.18' - - node_version: '12' - - node_version: '14' -branches: - only: - - master -install: - - ps: Install-Product node $env:node_version - - npm install -test_script: npm run validate -cache: - - ~/.npm -build: off