From c7fedcaeaf23c030862156eb629d877c52821a5a Mon Sep 17 00:00:00 2001 From: Usama Sadiq Date: Tue, 26 Oct 2021 19:24:47 +0500 Subject: [PATCH 1/2] build: Replace Travis with GitHub CI --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++++++++ .github/workflows/npm-publish.yml | 32 +++++++++++++++++++++++ .npmignore | 1 - .travis.yml | 22 ---------------- 4 files changed, 75 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/npm-publish.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..2c76e85f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: Node CI + +on: + push: + branches: + - master + pull_request: + branches: + - "**" + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Nodejs + uses: actions/setup-node@v2 + with: + node-version: 8 + + - name: Install Dependencies + run: npm ci + + - name: Lint + run: npm run lint + + - name: Build + run: npm run build + + - name: Send failure notification + if: ${{ failure() }} + uses: dawidd6/action-send-mail@v3 + with: + server_address: email-smtp.us-east-1.amazonaws.com + server_port: 465 + username: ${{secrets.EDX_SMTP_USERNAME}} + password: ${{secrets.EDX_SMTP_PASSWORD}} + subject: CI workflow failed in ${{github.repository}} + to: arch-team@edx.org + from: github-actions + body: CI workflow in ${{github.repository}} failed! For details see "github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 00000000..74e15b11 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,32 @@ + +on: + push: + tags: + - "*" + +jobs: + release: + name: Release + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 12 + + - name: Install dependencies + run: npm ci + + - name: Create Build + run: npm run build + + - name: Release Package + env: + GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} + run: npm run semantic-release diff --git a/.npmignore b/.npmignore index 717aca37..aee0f98f 100644 --- a/.npmignore +++ b/.npmignore @@ -1,7 +1,6 @@ .edx-bootstrap .gitignore .npmignore -.travis.yml _config.yml doc node_modules diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6691b36b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: node_js -node_js: -- 8 -notifications: - email: - recipients: - - abutterworth@edx.org - on_success: never - on_failure: always -install: - - npm install -script: -- npm run lint -- npm run build -after_success: -- npm run semantic-release -env: - global: - # NPM_TOKEN - - secure: T2YtAlyBcPuc9+KmsMTXI4E/kKEQmNXCLC7wgqlH81tPwtpsoUnkzWfNCAGk5YEgY/VOnFgAU2vINn8WtCqRbvX9WPP50J3kcwREtSusyGZ/dtXtoXw0il8LlOJ4ol99gUKW46SnC9z8pkBKTyENZKk5afW73GGB7+hqSLnm2n5Ls8m993Hsh1aTJXm4ZqlORU2Avlk3Ttrx1mdcz08snzEzjkBj4KViRXgNAuyZycXhmLL4NrtxSVurpBHTfXffcWywuZJ0Euie1q3IdXB4sLf7OMyg1ZoiOuql7Q05eEnY7stGHHKfUPWzlrkFHxBvzM6yB0bvf0nNCAb4FV0eWvn3VcL1wgLNjNJiO0cGnpwkzMybDIZebfqGUuA25CBCbcAPEWbxioUNrID+1KAajQvS3HScG6z8rjrf01NoDZ5g9fynnHGUN0ivlVOoI4aYCndmtYu+qhf8yFW3w8JMk7gd7EJHiq7IeToz871IpDZbqxUGOx4KyJQhxOsWpMiW0Sqvbq1rS9ExCnZ7FI/5/dZCb2wgbkMubwbahJnNJTZRqag85VY3gr2wNlGvy+DdL1nJzD2ZJzf/tZjnAshtVwW/lokgP+lrM/FtblLNY+eGbMhWJHb7tRD6yk7cP/A+K+k9fyVX8HmVPnMfzY3E+z9Iyj/3bKy4Nn4ilpiOzjk= - # GH_TOKEN - - secure: mcaptZElUzMCyzo2ll4lRmcuCbqN+S/rLU0AkM3IxAw40dbPI1fFtGtKZA5EIgCu+S8MX06fzlJ15eF8vWP1d/kAUp6hBws4c9yF5M3PGhKqPSZLys5lLGq4+sWv6IyU/X9WaWiQsvt8BomnKlWhlQu0Po5f0ckDVo/36A69cxUSvII9sGZsJC82CoaaP/6672QlxXXOBepCD+OtIrQq2PGU4W41YX2uhVIxGbdxdKj/+KWbO63rdrbKcVH2gVB7NKtLHEcCDD+7GKn1yH+C6KINaa3cDZQo3q91Cv7RcjvdOL1L+j5dmiVmZRNX1QngVMGRcgsdWHhs8L/5B39e1ksnes60eeQtL6u5RhNyAylyvfN/cVaCC+DRYwpr9SFPQ51YK40BKULC7fueSOXMR1OGRXNEjRaL694vJ7KjCg4GOuxf+DZcFyABQvABcUEwKj4ayn/vWCUSyTly0VgSOxxQLtqj5WObj3asrsCAwQUJ0jAXsFP7WAAzJSheb5R1kHAkTtqp4gcn8miuujCEp4kMw6YfvmwWUb5ZrSP72QxQ3retdrPfokaThcfxfGFnzfVCOoD4DEaWTxLbPKyPcYYnpskfgEmbHiR44qEfUL/lAqBncqUgo4A02GUpCajPzOqA1vpvfE9DT8oMw4Kk37SIAKNao225EgBU3j45qDM= From 0aa0d34be8ee63f78bd354e56e958bdff87b335d Mon Sep 17 00:00:00 2001 From: UsamaSadiq Date: Tue, 16 Nov 2021 15:42:21 +0500 Subject: [PATCH 2/2] build: trigger release on master push --- .github/workflows/npm-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 74e15b11..07410f5b 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,8 +1,8 @@ on: push: - tags: - - "*" + branches: + - master jobs: release: