From daaa5b2f59d06d0c38ba689c5b781ceecc177cdc Mon Sep 17 00:00:00 2001 From: AlexisG Date: Fri, 11 Oct 2024 15:44:00 +0200 Subject: [PATCH] chore: Add CI with Github Actions And remove Travis --- .github/workflows/ci-cd.yml | 42 +++++++++++++++++++++++++++ .travis.yml | 50 -------------------------------- id_rsa_downcloud_mespapiers.enc | Bin 2608 -> 0 bytes 3 files changed, 42 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/ci-cd.yml delete mode 100644 .travis.yml delete mode 100644 id_rsa_downcloud_mespapiers.enc diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 00000000..0bb5b590 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,42 @@ +name: CI/CD + +on: + pull_request: + push: + branches: + - master + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' + +env: + MATTERMOST_CHANNEL: '{"dev":"mespapiers","beta":"mespapiers,publication","stable":"mespapiers,publication"}' + MATTERMOST_HOOK_URL: ${{ secrets.MATTERMOST_HOOK_URL }} + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + +jobs: + build: + name: Build and publish + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Lint + run: yarn lint + - name: Test + run: yarn test + - name: Build + run: yarn build + - name: Set SSH for downcloud + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.DOWNCLOUD_SSH_KEY }} + - name: Publish + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') + run: yarn run cozyPublish --yes diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 163598c4..00000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -dist: jammy -language: node_js -branches: - only: - - master - # tags - - /^\d+\.\d+\.\d+(\-beta.\d+)?$/ -env: - global: - - MATTERMOST_CHANNEL='{"dev":"app---mes-papiers","beta":"app---mes-papiers,publication","stable":"app---mes-papiers,publication"}' - # MATTERMOST_HOOK_URL - - secure: "M9AsiCREqvJIMNl79X+9WShz1KqBg3fuakfdOM4gu7lSGe5vdP5JvoCZdAgQSzuGmLv3uBG4qPb/5Zenf1alHPFQczwxJCove3sMdsRcc7TvvnexfP/UzTPsj/nFiEQ5ikIUI3yZcOWFce48SqvlLfgMtapeGrDvwixz1prcV7c0+D3fiKLdv900RIo9lf/Pxy4kh9IlIO5/lpt7MvWX+212tliM68VRB+3Tml24xLZt1eAIPGva6cNy8Jsrmpc88ukLyCHn9NU6/2qhz/Idwgbcy8lPRnzIUdat++OJEnVP+KSpEeia3VuUAvcZIUpiVn1BVgFNqqe5LPLHPm79rjf4faCjUJl3BGwkdB+4vNYqVFzhO1sviv1KMU4IM3iEBg1rYOK/ENTON0Mo66HU6da4vKxmql4wpts3I2q9xAkorkbmKPiwigRegFu/3B0k4QfvxVUN+9/F+UOql054rJr+QPtjwM3ZhpK7okkmkZVl4sWlsfugBoP2VoaH7XA8EvNGhsAR9lvQZAYhF3oVkqpffPbX3+TIw9BMs7pvGm/+/o1pseFea1f3aupE3uc8CpmTpvJ9e+skxOARjJZuemUADshjxsPVyKH5g3wbeI6OvINYUPnDDcc6uofo1+v3hBm8mRcvy/dGEHMmOmRQ6zho1hKc9z81FUOCPn3zY/s=" - # GITHUB_TOKEN - - secure: "MNLL/CzWnHrQNWmwMjOHhahtPU13WzBHmF47f9JaBwFOXX8YXPh4Of91pxBnQs7RFBwnCNgG/mSbulwKiFerJR9DtyqkxE26aF5QncRY5YkXqJKKL213iI+QY1EyIbkZ3x+N92661kvuJkpWLh1iFwaOSza4hefbCORxUZdPFMyEbYh3Q2IoIKfPT0M9KCp/7hru4OXgCXY3b4u4vEYD01r4G3Are5/QoBJZX5VzgVLW5cFCUyZbzvCHTM6tE1E+GJm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mcoNmCCrWyL856Ma+7RIL/kIXik2hNdbrLwUs6/bQtAiRUA=" -cache: - npm: false -jobs: - include: - - name: 'Lint' - script: yarn lint - - name: "Unit tests" - script: yarn test - - name: 'Build app' - script: - - yarn build - - yarn bundlemon - before_install: - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && openssl aes-256-cbc -K $encrypted_fdd8b84f377d_key -iv $encrypted_fdd8b84f377d_iv -in id_rsa_downcloud_mespapiers.enc -out id_rsa_downcloud_mespapiers -d' - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && eval "$(ssh-agent -s)"' - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && chmod 600 id_rsa_downcloud_mespapiers' - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && ssh-add id_rsa_downcloud_mespapiers' - before_deploy: - - yarn add cozy-app-publish # to be sure to have the last version before deploy - deploy: - - provider: script - repo: cozy/mespapiers - skip-cleanup: true - # deploy the build on a build branch and publish to the Cozy registry - script: yarn cozyPublish - on: - branch: master - - provider: script - repo: cozy/mespapiers - skip-cleanup: true - # publish stable or beta versions using Github Releases (git tag) - script: yarn cozyPublish - on: - tags: true diff --git a/id_rsa_downcloud_mespapiers.enc b/id_rsa_downcloud_mespapiers.enc deleted file mode 100644 index 4c1519a00350f0ccbc805d5b14217f612acd530c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2608 zcmV-03eWZD@5p6!TTadP_cpiU^O-Z%8-`YIUptqZBA)+%2D{OidycM)YNj%wjuNQn zpwYea-S3E|U-5GS3MhkALe<>_XiFAON}_cOZbc_{&@ZC}Aak@#=_oVEi0ZvAC;R zbccif?k7{+=!^_PEcm2BMfEm%@QN(Jde{AK_T?6;@8H4;GsPsWPc=epfAzlV>uNiq zNeY}Ees{T)z3BM)kSgR5|GI#d6tNK)8jBx$BSDMJc}GN^r!?BkU|tc=_l58Q5u$({6-S z$ZSz|p8JqqodJ(>4WO_Ga*^7gib>%0VM;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