From 8c2dc4f133d963122a068b584a1d8c68ff1302f4 Mon Sep 17 00:00:00 2001 From: Gabriel Duarte Date: Thu, 23 Mar 2023 02:35:11 +0000 Subject: [PATCH] move to github actions --- .github/workflows/nodejs.yml | 65 ++++++++++++++++++++++++++++++++++++ .travis.yml | 14 -------- 2 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/nodejs.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..ce318f5 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,65 @@ +name: CI + +on: [push, pull_request] + +env: + CI: true + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x, latest] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Echo versions used + run: echo "node:" && node --version && echo "" && echo "npm:" && npm --version && echo "" && echo "yarn:" && yarn --version + + - name: Install dependencies + run: yarn install + + - name: Run CI script + run: yarn run ci + + release: + runs-on: ubuntu-latest + + needs: build + + if: github.ref == 'refs/heads/master' + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16.x + + - name: Echo versions used + run: echo "node:" && node --version && echo "" && echo "npm:" && npm --version && echo "" && echo "yarn:" && yarn --version + + - name: Install dependencies + run: yarn install + + - name: Run build + run: yarn run build + + - name: Run semantic-release + run: yarn run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} + GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} + GOOGLE_REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c62a65e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js -cache: yarn -node_js: - - node - - lts/* -script: yarn ci -jobs: - include: - - stage: semantic-release - if: branch = master - node_js: node - script: - - yarn build - - yarn release