diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000000..c374fdfab9 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,45 @@ +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":"appvengers","beta":"appvengers,publication","stable":"appvengers,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: yarn install --frozen-lockfile + - name: Lint + run: yarn lint + - name: Test + run: yarn test + - name: Build + run: yarn build + - 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: yarn run cozyPublish --yes diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d08f160c06..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -language: node_js -node_js: 20 -dist: jammy -cache: - npm: false -branches: - only: - - master - # detect also tag like x.y.z or x.y.z-beta.n as travis consider them to be branches - - /^\d+\.\d+\.\d+(\-beta.\d+)?$/ -env: - global: - - MATTERMOST_CHANNEL='{"dev":"appvengers","beta":"appvengers,publication","stable":"appvengers,publication"}' - - secure: OLcPuglkDbRd9Xf8WmPAlAWTmdXDb+SNVc7+WKQjIap5Ej58BBTtaAYR8kzFKSWmvWWSnv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pvwrwmBl986QcyCTYE/5HS01dkWr4yvUKAQCPYeEySuDF9ISZ0qV2V1jdaJ2Hc0BZaGdYpYWctQCSwV6r7E+1r2OkeuWk1Zgs1zads89UHywy0dabfMxYDZhvm5EZ8OjZ2Sxb32mSxuy1jB61kqkFgvFNzu0BamCWf73zm1Z9qfjd3mlVd1cR+c2EkXIIMEW3o4ai+vzyBNNDFuICg7nuVeLE1F9a6w9qOGfwKF0zSyjwyIjLfGSClOqMv9IfVSFovPt1Gu4EgeOtATSRQQje3BUrqWe7HfaqeRegtWKReFWFNCgRBJ+ER05M1cGXOLYLjYMLEdOhvqqXv66bme7zTt6bf++Qpt98U8n8iwHiu4jHJ78kwP9MrNloAe6piwtX/2H9dPZ9Vebx9ZU0ytfndadXHDPeX7r4y/U1kbQ0J1ZQYl85iEB91+bkyY2JYFmr/qCuEGOT6Bz2A208RHAZ325kJh4uFkf4rNPZWnmPcht7frSbjLOBfphI= -jobs: - include: - - name: "Lint" - script: yarn lint - - name: "Unit tests" - script: yarn test - - name: "Build app" - before_script: - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && openssl aes-256-cbc -K $encrypted_2911d206c096_key -iv $encrypted_2911d206c096_iv -in id_ed25519_downcloud_drive.enc -out id_ed25519_downcloud_drive -d' - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && eval "$(ssh-agent -s)"' - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && chmod 600 id_ed25519_downcloud_drive' - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && ssh-add id_ed25519_downcloud_drive' - script: - - yarn build - - yarn bundlemon - before_deploy: - - yarn add cozy-app-publish # to be sure to have the last version before deploy - deploy: - - provider: script - repo: cozy/cozy-drive - skip_cleanup: true - script: yarn run deploy - on: - # deploy the build on a build branch and publish to the Cozy registry - branch: master - - provider: script - repo: cozy/cozy-drive - skip_cleanup: true - script: yarn run deploy - on: - # publish stable or beta versions using Github Releases (git tag) - tags: true - diff --git a/id_ed25519_downcloud_drive.enc b/id_ed25519_downcloud_drive.enc deleted file mode 100644 index 2b983db6b6..0000000000 Binary files a/id_ed25519_downcloud_drive.enc and /dev/null differ diff --git a/package.json b/package.json index 277865e874..95e965aa30 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "build": "cozy-scripts build --barV7 false --cozyClientJs", "watch": "cozy-scripts watch --barV7 false --cozyClientJs", "start": "cozy-scripts start --barV7 false --cozyClientJs", - "deploy": "cozy-app-publish --token $REGISTRY_TOKEN --prepublish downcloud --postpublish mattermost", + "cozyPublish": "cozy-app-publish --token $REGISTRY_TOKEN --prepublish downcloud --postpublish mattermost", "tx": "tx pull --all || true", "lint": "npm-run-all --parallel 'lint:*'", "lint:styles": "stylint src --config ./node_modules/cozy-scripts/config/.stylintrc",