From e999786b05b6dc36fe404d1f5aed37800d851486 Mon Sep 17 00:00:00 2001 From: AlexisG Date: Wed, 16 Oct 2024 17:05:41 +0200 Subject: [PATCH] chore: Add CI with Github Actions And remove Travis --- .bundlemonrc | 15 +++++++++ .github/workflows/ci-cd.yml | 43 ++++++++++++++++++++++++++ .nvmrc | 2 +- .travis.yml | 47 ----------------------------- id_rsa_downcloud_cozy_pass_web.enc | Bin 2624 -> 0 bytes package.json | 1 + 6 files changed, 60 insertions(+), 48 deletions(-) create mode 100644 .bundlemonrc create mode 100644 .github/workflows/ci-cd.yml delete mode 100644 .travis.yml delete mode 100644 id_rsa_downcloud_cozy_pass_web.enc diff --git a/.bundlemonrc b/.bundlemonrc new file mode 100644 index 000000000..bc6188538 --- /dev/null +++ b/.bundlemonrc @@ -0,0 +1,15 @@ +{ + "baseDir": "./build-browser", + "files": [ + { + "path": "app/main..js" + }, + { + "path": "app/main.js" + }, + { + "path": "app/vendor.js" + } + ], + "reportOutput": ["github"] +} diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 000000000..2b9925e9c --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,43 @@ +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":"feat---password-mgr","beta":"feat---password-mgr,publication","stable":"feat---password-mgr,publication"}' + MATTERMOST_HOOK_URL: ${{ secrets.MATTERMOST_HOOK_URL }} + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + BUNDLEMON_PROJECT_ID: ${{ secrets.BUNDLEMON_PROJECT_ID }} + +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: npm install --frozen-lockfile --legacy-peer-deps + - name: Lint + run: npm run lint + - name: Build + run: npm run build:browser:prod + - name: BundleMon + uses: lironer/bundlemon-action@v1 + - 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: npm run cozyPublish --yes diff --git a/.nvmrc b/.nvmrc index ab155ce13..158c00641 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v14.15.5 +v14.16.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9fef06b82..000000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -language: node_js -matrix: - fast_finish: true -node_js: -- '14' -branches: - only: - - master - # tags - - /^\d+\.\d+\.\d+(\-beta.\d+)?$/ -env: - global: - - MATTERMOST_CHANNEL='{"dev":"feat---password-mgr","beta":"feat---password-mgr,publication","stable":"feat---password-mgr,publication"}' - # GITHUB_TOKEN for yarn deploy script - - secure: "jEPzBB2l9h4xyTqVI4SY2G3EHk35B5QldDnt5obpl74yUookiIV2h8Hwr7LwHwXzN3M83MCORelZ9VG1BbbZ3pqi68Fybe6A38cFVirmQa3ylsXRYCNnE/YOul+aXSwqQuC8SYeLcqpg3oLiZQJdCohP7LG4MqNJexHT21mjgrPI7FB/h1feVu9gzsIxtJ1hhSeGgW3Q7HT6Na1wA53UJ/bU1w84rHbjoDxLWw9jd93W+rMr9UTtWzeC6SL6iFi9Pd4N1vKjWFlEEWBAv8dH09LrmBuZMtKZtN7ZNfN3wDGzdvnp7Kj87pJf2yaiFtWCfJknM5RbXE93BIGSynOOaJsqoooo49QbwsLoygmc3VmbOc4QPusC1EdrF5/EaEeMuPuH/N/Zjo8lopjfpqIRSEGrZiCc6Ing+l0WgzCJ1LEPormONTqA6WF/0a3DtKPWMV76wJYIXeHz6DAvYskYwbrMgsPxTKxQO7lfNCX0azIFqodTdDPZTcxh9AJRURKJwZ4BV9AiPEadOzD+iB4yi3Fw226kNoNvUTjpexd0kenQb/kQNXBNAssPcPHiM/BRIf+l7n9thmWom4K2VQ49OFSG+v+I3pR7s8DZtxJALdWiFL2imf2PHhD0kapCki7nTWkZ0yC9AndYm7qQblUotV7Mp+bpdd2WX0Npcu40vYA=" - # REGISTRY_TOKEN for yarn cozyPublish script - - secure: "wMOM7oD/Q//k8dho5K/dn+BagOeCMXm/60XJ+Gb07C4w6ynuQgiuANPM6f5eguflodTUX0Sv5D7x+y8+bITPc1aI7QbVDWphJa7UrCfNKgkTvU39jWDFkG1ZdYom6cngoosZ18ndVJ/L6K7YpM0FvmIl9tGneXIWbZoy2rBeoqMff1Ispc34TcKEvMyKyNgxaVb32vcp4nwDzwrHjjWAhSElfUCk5SAqb7ThtTGgWwWAfxhuQ1WxVI2QmM1fabuYaT5eXwrMlS9XG67QXwRash+9MG554J3CM0vG6RIVc2ThJp/ptaR9ASlimYSn29+E5EiAEAJdF9JQD07OKW2E2+UD8M9QWzQhp3x6kGj1YZY68DEBvQGcBFvoyW+0wPdTUbJXiFpy0hmiFxeV5F3Dux00y2Hi7arPq5ma+eh5oLwE+Z1QlBswMth57yiRtMJCv9EY0xmOveNpHmaUz9paXgZU5u9r2imubkVtUCCXd5iBwNX20MU0q5frGKLDeG+nVBJ6+g84nia3KgSG9tV+xRjSvsBpB6tUPbLzjNQTcyvqIIHv6chW5/9dVPxfk3grfOjpzh6mdd/F3qIP1cqOXqq118KJmRteZLmbharGqVbKbwZpA9pjf8JsuONvSmZm7LIoVwoGGKggWi5uybysH/IkMtho1m7qQfAdkI2f/mI=" - # MATTERMOST_HOOK_URL for yarn cozyPublish script - - secure: "eHY0FQI3/rY1Q1gQkcNmLJo/LK0IyPyNrcVqbtYbMP7MmHBXAYh10JmKW2A8DbHmIE364J4kkCMYRICpn4lxXcTe2p3zBYy03q4bzwoKUpyTxUI0zjOeHQnGb1AsiP8mO3kAgontXbCl0X29AhmaQotK6jrQV+2ZEQ6jtyqe/ByZGPlsE1xVhOJgbREM2nSAidP3OcBzW7tsEeIciPYqoB9LsiSfzNM5nkfUodxO36gkh05tP3gE6Y8zP4HsbnUUHGafjpLLhRviIrK/DB8aDUzbxHRK7/g2D0FYsM8HYYfO3i/Agegt5/ImY2KM+K0mrn5UVDqFfhkSVjBetdiZCxSzC4rx+ljr9Kxp0deu/02ckapRj9x6PPLTs3BPWZT/h7IxTNYnpOpCIipHRtgyLjqH1ycvrHc+y7h5vOzX6hM/sF14LFp2RWddhQgr+iCXSIg6jK0OVPGdt57pum+hnZH2Yl96oSd8+YJG51KduOYau2iXrTtYu8XoYEdijxyMfzf6hueop/ymsr+3unbRzfrBrOkaYz2Yn+H8thY7VY1ofJoL2Ebmt8kIeRBx6sYcuVvfqOIxJItJxYegUGDFmIq02SMftOhT19MkzMJatVYPuwzP7RhKMkCy+0LCTNxP7RZ0W9Zgo7SRMF+cihkzn0SgtE/oLro/e/DNYsAG/gg=" -cache: - yarn: true - directories: - - node_modules -script: - - npm run lint - - npm run build:browser:prod -before_install: - - sudo apt-get install libsecret-1-dev - - if [ "$TRAVIS_SECURE_ENV_VARS" != "false" ]; then openssl aes-256-cbc -K $encrypted_95a52b3b9b3c_key -iv $encrypted_95a52b3b9b3c_iv -in id_rsa_downcloud_cozy_pass_web.enc -out id_rsa_downcloud_cozy_pass_web -d; fi - - if [ "$TRAVIS_SECURE_ENV_VARS" != "false" ]; then eval "$(ssh-agent -s)"; fi - - if [ "$TRAVIS_SECURE_ENV_VARS" != "false" ]; then chmod 600 id_rsa_downcloud_cozy_pass_web; fi - - if [ "$TRAVIS_SECURE_ENV_VARS" != "false" ]; then ssh-add id_rsa_downcloud_cozy_pass_web; fi -before_deploy: - - yarn add cozy-app-publish -deploy: - - provider: script - skip_cleanup: true - # deploy the build on downcloud and publish to the Cozy registry - script: yarn cozyPublish - on: - branch: master - - provider: script - skip_cleanup: true - # publish stable or beta versions using Github Releases (git tag) - script: yarn cozyPublish - on: - tags: true \ No newline at end of file diff --git a/id_rsa_downcloud_cozy_pass_web.enc b/id_rsa_downcloud_cozy_pass_web.enc deleted file mode 100644 index ce6427a0b26a20da65bc6c3554df1997a0d8c2a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2624 zcmV-G3cvL|9*THw_+gig78l*Tm@=DygDolYKrq#tp6}s}!sFPd2K45TNIH;g-eRD6 zN5&+ORejZ(zlb9b*PB4;ev2)C!$fRAcypy|DxB+=GFYx8Z_|``s?{(Io;)%k5?G!M zA)39$R0c~g!;&3Km|Tvby)_`&c!7!VcAs>2V(0ED-{3u7$B6;hEit@kkSOizMk%$u zyTm7^-A-TEj)nnwV|<2}HzZw3s2;E8A`UCQu}I+f zX3OoRz(kFo*pJAy6a`u6o)OeK6e`#al2^8R6iH8_gvk&$>gPa!>=4O$XbXFWe)Qw z-xakDF}~mlHnPmIU91Dn&xKj6;ZyQg@Q|I6u}=)JHM#SX*~kbr0Z@<`!!gqsiN`f* zVA`cy><&!zk1V=Uh~E8GaLcp4?+l;$98U+p{G!z2F2|YIY!DEu0n1f)YG!ztR)qCp@pnq0y52S3xVzC?(4u zpyf_5PqfQPiJcNa@#s6O*Y4YxpN<6_z0OV(uvLj;X_{1p%;%gjM#*>uljky)x2O?& z_chw6AV}!rnSg$buAJ>}f~272&&0=3vSasOdH-e=Wl6RGadQdt?F`PX8i6FzE1x=Q zkJ4Ox$*!Gh#Rnx!KWQ9#+h23GH$Lr{BL~6MIxys=jCY~&@&W-T!c)L{1>f$QTBzog>`E5i$^B@h|Ji!!A0Hk0Pw@D6DRf>B zsETxRx8Xcv^;Yg7x+w%o+f`LAcuBynfUp1Rwa^T@n=VE}u`b~%D~=}pv6I_siy3id zQ0VLn8T)R12CRo==yrZY!1i(y#EqipA8|)v4t->U_O?8lFT?a<=s}{~{_K*5H(3<1 z^O6M;+hfW=GRL5CDjp){r}Mw<&}ko+?%N9crB|13m}NqU{f`PQQ<38_VVj=jvR`t* zkX|k+rfu^A51>r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D@?1J1->cyi2XX{3kLi_g>8TH!U9(qj`4n>i?klqt11|;u diff --git a/package.json b/package.json index f47118c33..253f9d760 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "@types/zxcvbn": "^4.4.1", "babel-loader": "^8.2.2", "babel-preset-cozy-app": "^1.11.0", + "bundlemon": "1.4.0", "clean-webpack-plugin": "^3.0.0", "concurrently": "^6.0.2", "copy-webpack-plugin": "^6.4.0",