From 274f3acd454f25ff0cd4160dbb26e8f663fee760 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Mon, 1 Feb 2021 14:10:21 +0000 Subject: [PATCH] Added GH Releases and NPM actions --- .github/workflows/{main.yml => master.yml} | 12 ++--- .github/workflows/releases.yml | 57 ++++++++++++++++++++++ .travis.yml | 55 --------------------- 3 files changed, 60 insertions(+), 64 deletions(-) rename .github/workflows/{main.yml => master.yml} (78%) create mode 100644 .github/workflows/releases.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/master.yml similarity index 78% rename from .github/workflows/main.yml rename to .github/workflows/master.yml index 00068a77..c9139ec7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/master.yml @@ -1,4 +1,4 @@ -name: Test & Deploy +name: Master on: push: @@ -30,12 +30,14 @@ jobs: npx grunt testnodeconsumer - name: Production Build + if: success() run: npx grunt prod - name: Generate sitemap run: npx grunt exec:sitemap - name: UI Tests + needs: Production Build run: xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui - name: Prepare for GitHub Pages @@ -49,11 +51,3 @@ jobs: build_dir: ./build/prod env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - #- name: Deploy to NPM - # run: | - # npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN - # npm publish || true - # env: - # Add NPM publish token to the repo secrets - # NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml new file mode 100644 index 00000000..a3e51c18 --- /dev/null +++ b/.github/workflows/releases.yml @@ -0,0 +1,57 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set node version + uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Install + run: | + npm install + export NODE_OPTIONS=--max_old_space_size=2048 + + - name: Lint + run: npx grunt lint + + - name: Unit Tests + run: | + npm test + npx grunt testnodeconsumer + + - name: Production Build + if: success() + run: npx grunt prod + + - name: UI Tests + needs: Production Build + run: xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + + - name: Upload Release Assets + needs: UI Tests + if: success() + id: upload-release-assets + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/prod/*.zip + tag: ${{ github.ref }} + overwrite: true + file_glob: true + + - name: Publish to NPM + needs: UI Tests + if: success() + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5c247911..00000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -language: node_js -node_js: - - lts/dubnium -cache: npm -os: linux -addons: - chrome: stable -install: npm install -before_script: - - npm install -g grunt - - export NODE_OPTIONS=--max_old_space_size=2048 -script: - - grunt lint - - npm test - - grunt testnodeconsumer - - grunt prod --msg="$COMPILE_MSG" - - xvfb-run --server-args="-screen 0 1200x800x24" grunt testui -before_deploy: - - grunt exec:sitemap - - grunt copy:ghPages -deploy: - - provider: pages - edge: true - token: $GITHUB_TOKEN - local_dir: build/prod/ - target_branch: gh-pages - on: - repo: gchq/CyberChef - branch: master - - provider: releases - edge: true - token: - secure: "HV1WSKv4l/0Y2bKKs1iBJocBcmLj08PCRUeEM/jTwA4jqJ8EiLHWiXtER/D5sEg2iibRVKd2OQjfrmS6bo4AiwdeVgAKmv0FtS2Jw+391N8Nd5AkEANHa5Om/IpHLTL2YRAjpJTsDpY72bMUTJIwjQA3TFJkgrpOw6KYfohOcgbxLpZ4XuNJRU3VL4Hsxdv5V9aOVmfFOmMOVPQlakXy7NgtW5POp1f2WJwgcZxylkR1CjwaqMyXmSoVl46pyH3tr5+dptsQoKSGdi6sIHGA60oDotFPcm+0ifa47wZw+vapuuDi4tdNxhrHGaDMG8xiE0WFDHwQUDlk2/+W7j9SEX0H3Em7us371JXRp56EDwEcDa34VpVkC6i8HGcHK55hnxVbMZXGf3qhOFD8wY7qMbjMRvIpucrMHBi86OfkDfv0vDj2LyvIl5APj/AX50BrE0tfH1MZbH26Jkx4NdlkcxQ14GumarmUqfmVvbX/fsoA6oUuAAE9ZgRRi3KHO4wci6KUcRfdm+XOeUkaBFsL86G3EEYIvrtBTuaypdz+Cx7nd1iPZyWMx5Y1gXnVzha4nBdV4+7l9JIsFggD8QVpw2uHXQiS1KXFjOeqA3DBD8tjMB7q26Fl2fD3jkOo4BTbQ2NrRIZUu/iL+fOmMPsyMt2qulB0yaSBCfkbEq8xrUA=" - file_glob: true - file: - - build/prod/*.zip - - src/node/cjs.js - on: - repo: gchq/CyberChef - tags: true - - provider: npm - edge: true - email: "n1474335@gmail.com" - api_token: - secure: "UnDQL3Kh+GK2toL0TK3FObO0ujVssU3Eg4BBuYdjwLB81GhiGE5/DTh7THdZPOpbLo6wQeOwfZDuMeKC1OU+0Uf4NsdYFu1aq6xMO20qBQ4qUfgsyiK4Qgywj9gk0p1+OFZdGAZ/j1CNRAaF71XQIY6iV84c+SO4WoizXYrNT0Jh4sr2DA4/97G2xmJtPi0qOzYrJ09R56ZUozmqeik5G0pMRIuJRbpjS/7bZXV+N7WV0ombZc9RkUaetbabEVOLQ+Xx5YAIVq+VuEeMe9VBSnxY/FfCLmy1wJsjGzpLCyBI9nbrG4nw8Wgc2m8NfK9rcpIvBTGner9r2j60NVDkZ8kLZPrqXhq6AZMwa+oz6K5UQCqRo2RRQzSGwXxg67HY5Tcq+oNmjd+DqpPg4LZ3eGlluyP5XfG+hpSr9Ya4d8q8SrUWLxkoLHI6ZKMtoKFbTCSSQPiluW5hsZxjz3yDkkjsJw64M/EM8UyJrgaXqDklQu+7rBGKLfsK6os7RDiqjBWpQ7gwpo8HvY0O8yqEAabPz+QGkanpjcCOZCXFbSkzWxYy37RMAPu88iINVZVlZE4l+WJenCpZY95ueyy0mG9cyMSzVRPyX6A+/n4H6VMFPFjpGDLTD588ACEjY1lmHfS/eXwXJcgqPPD2gW0XdRdUheU/ssqlfCfGWQMTDXs=" - on: - tags: true - branch: master -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/83c143a6822e218d5b34 - on_success: change - on_failure: always - on_start: never