diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a29eae5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release +on: + push: + branches: + - master + - next + - beta + - "*.x" # maintenance releases + +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm ci + - run: npm run build + - run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9132fc3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: Test +on: + push: + branches: + - master + - "greenkeeper/**" + pull_request: + types: [opened, synchronize] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: [10, 12, 14] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node_version }} + - name: Install + run: npm ci + - name: Test + run: npm test diff --git a/.github/workflows/update-prettier.yml b/.github/workflows/update-prettier.yml new file mode 100644 index 0000000..edbff89 --- /dev/null +++ b/.github/workflows/update-prettier.yml @@ -0,0 +1,23 @@ +name: Update Prettier +on: + push: + branches: + - "greenkeeper/prettier-*" +jobs: + update_prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm ci + - run: npm run lint:fix + - uses: gr2m/create-or-update-pull-request-action@v1.x + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + title: "Prettier updated" + body: "An update to prettier required updates to your code." + branch: ${{ github.ref }} + commit-message: "style: prettier" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2214ad4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: node_js -cache: npm - -# Trigger a push build on master and greenkeeper branches + PRs build on every branches -# Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147) -branches: - only: - - master - - /^greenkeeper.*$/ - -stages: - - test - - name: release - if: branch = master AND type IN (push) - -jobs: - include: - - stage: test - node_js: 10 - script: npm run test - - node_js: 12 - script: npm run test - - - stage: release - node_js: lts/* - env: semantic-release - script: - - npm run build - - npx semantic-release diff --git a/README.md b/README.md index d00d14c..170ae0c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > Get a user agent string in both browser and node [![@latest](https://img.shields.io/npm/v/universal-user-agent.svg)](https://www.npmjs.com/package/universal-user-agent) -[![Build Status](https://travis-ci.com/gr2m/universal-user-agent.svg?branch=master)](https://travis-ci.com/gr2m/universal-user-agent) +[![Build Status](https://github.com/gr2m/universal-user-agent/workflows/Test/badge.svg)](https://github.com/gr2m/universal-user-agent/actions?query=workflow%3ATest+branch%3Amaster) [![Greenkeeper](https://badges.greenkeeper.io/gr2m/universal-user-agent.svg)](https://greenkeeper.io/) ```js