diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4dbc0ed..979bcd95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,4 +51,55 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ./lcov.info \ No newline at end of file + path-to-lcov: ./lcov.info + release: + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + id: node-cache + with: + path: ~/.npm + key: ${{ runner.os }}-node-16-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-16- + - name: Use node version 16 + uses: actions/setup-node@v2 + with: + node-version: 16 + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: npm run build:docs + - name: Publish docs to github pages + uses: JamesIves/github-pages-deploy-action@4.1.3 + with: + branch: gh-pages + folder: docs/build + nightly: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + id: node-cache + with: + path: ~/.npm + key: ${{ runner.os }}-node-16-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-16- + - name: Use node version 16 + uses: actions/setup-node@v2 + with: + node-version: 16 + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm version "$(npm view currency.js@latest version)-${GITHUB_SHA:0:8}" --allow-same-version --no-git-tag-version + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cbcc8695..00000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: node_js -node_js: -- node -- '10' -before_install: -- npm install -g coveralls -script: -- npm run build -- npm run lint -- npm run test -sudo: false -cache: - directories: - - node_modules -after_success: -- npm run coverage -- npm run coverage:report -- if [ "$TRAVIS_BRANCH" = "master" ]; then npm run build:docs; fi -before_deploy: - - if [ "$TRAVIS_BRANCH" = "master" ]; then - npm version "$(npm view currency.js@latest version)-${TRAVIS_COMMIT:0:8}" --allow-same-version --no-git-tag-version; - fi -deploy: -- provider: npm - skip_cleanup: true - api_key: "$NPM_TOKEN" - email: "$NPM_EMAIL" - on: - tags: true - node: node -- provider: npm - skip_cleanup: true - api_key: "$NPM_TOKEN" - email: "$NPM_EMAIL" - on: - branch: master - node: node - tag: next -- provider: pages - skip_cleanup: true - github_token: "$GH_TOKEN" - keep_history: true - local_dir: docs/build - on: - branch: master - node: node