Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Clean package.josn #8

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 25 additions & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
dist: focal
node-preset: &node # Used internally to share configuration, ignored by travis.
language: node_js
node_js:
- 16
- 20
cache:
yarn: true
directories:
- node_modules
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.4
- export PATH="$HOME/build/cozy/cozy-photos:$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
language: node_js
node_js: 16
dist: jammy
cache: yarn
branches:
only:
- master
Expand All @@ -32,56 +23,44 @@ stages:
- build
jobs:
include:
- name: "Lint"
stage: "prebuild"
<<: *node
- name: 'Lint'
stage: 'prebuild'
script: yarn lint
- name: "Unit tests node 16"
stage: "prebuild"
<<: *node
node_js:
- 16
- name: 'Unit tests node 16'
stage: 'prebuild'
node_js: 16
script: yarn test
- name: "Unit tests node 20"
stage: "prebuild"
<<: *node
node_js:
- 20
- name: 'Unit tests node 20'
stage: 'prebuild'
node_js: 20
script: yarn test
- name: "Photos web"
stage: "build"
<<: *node
env:
- COZY_APP_SLUG=photos
before_script:
- yarn run cozy-ci-transifex
- '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && openssl aes-256-cbc -K $encrypted_497d1a9dc404_key -iv $encrypted_497d1a9dc404_iv -in id_rsa_downcloud_photos.enc -out id_rsa_downcloud_photos -d'
- '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && eval "$(ssh-agent -s)"'
- '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && chmod 600 id_rsa_downcloud_photos'
- '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && ssh-add id_rsa_downcloud_photos'
- name: 'Build app'
stage: 'build'
script:
- echo 'pull langages' && echo -en 'travis_fold:start:txpull\\r'
- yarn tx
- echo -en 'travis_fold:end:txpull\\r'
- echo 'build' && echo -en 'travis_fold:start:build\\r'
- yarn build:$COZY_APP_SLUG:browser
- yarn build
- echo -en 'travis_fold:end:build\\r'
#- echo 'create and deploy' && echo -en 'travis_fold:start:createanddeploy\\r'
#- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then ./scripts/create-deploy-test.sh; fi
#- echo -en 'travis_fold:end:createanddeploy\\r'
#- echo 'delete instance' && echo -en 'travis_fold:start:deleteinstance\\r'
#- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then ./scripts/delete-instance.sh; fi
#- echo -en 'travis_fold:end:deleteinstance\\r'
before_script:
- yarn run cozy-ci-transifex
- '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && openssl aes-256-cbc -K $encrypted_497d1a9dc404_key -iv $encrypted_497d1a9dc404_iv -in id_rsa_downcloud_photos.enc -out id_rsa_downcloud_photos -d'
- '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && eval "$(ssh-agent -s)"'
- '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && chmod 600 id_rsa_downcloud_photos'
- '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && ssh-add id_rsa_downcloud_photos'
before_deploy:
- yarn add cozy-app-publish
- yarn add cozy-app-publish # to be sure to have the last version before deploy
deploy:
- &deploy
provider: script
repo: cozy/cozy-photos
skip-cleanup: true
script: yarn run deploy:$COZY_APP_SLUG
script: yarn run deploy
on:
# deploy the build on a build branch and publish to the Cozy registry
branch: master
- <<: *deploy
on:
# publish stable or beta versions using Github Releases (git tag)
tags: true
48 changes: 6 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,20 @@
"version": "1.64.0",
"main": "src/main.jsx",
"scripts": {
"build": "yarn build:drive && yarn build:photos",
"build:drive": "yarn build:drive:browser",
"build:drive:browser": "COZY_APP_SLUG=drive cozy-scripts build --manifest src/drive/targets/manifest.webapp --build-dir build/drive --src-dir src/drive --barV7 false --cozyClientJs",
"build:drive:mobile": "COZY_APP_SLUG=drive cozy-scripts build --mobile --manifest src/drive/targets/manifest.webapp --src-dir src/drive --barV7 false --cozyClientJs",
"watch:drive": "yarn watch:drive:browser",
"watch:drive:browser": "COZY_APP_SLUG=drive cozy-scripts watch --manifest src/drive/targets/manifest.webapp --build-dir build/drive --src-dir src/drive --barV7 false --cozyClientJs",
"watch:drive:mobile": "COZY_APP_SLUG=drive NODE_ENV=mobile:development cozy-scripts watch --manifest src/drive/targets/manifest.webapp --src-dir src/drive --barV7 false --cozyClientJs",
"start:drive:browser": "COZY_APP_SLUG=drive cozy-scripts start --manifest src/drive/targets/manifest.webapp --build-dir build/drive --src-dir src/drive --barV7 false --cozyClientJs",
"start:drive:mobile": "COZY_APP_SLUG=drive NODE_ENV=mobile:development cozy-scripts start --mobile --manifest src/drive/targets/manifest.webapp --src-dir src/drive --barV7 false --cozyClientJs",
"start:drive:standalone": "COZY_APP_SLUG=drive NODE_ENV=mobile:development cozy-scripts start --manifest src/drive/targets/manifest.webapp --src-dir src/drive --barV7 false --cozyClientJs",
"build:photos": "yarn build:photos:browser",
"build:photos:browser": "COZY_APP_SLUG=photos cozy-scripts build --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs",
"watch:photos": "yarn watch:photos:browser",
"watch:photos:browser": "COZY_APP_SLUG=photos cozy-scripts watch --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs",
"start:photos:browser": "COZY_APP_SLUG=photos cozy-scripts start --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs",
"deploy:drive": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/drive/' --prepublish downcloud --postpublish mattermost",
"deploy:photos": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/photos/' --prepublish downcloud --postpublish mattermost",
"build": "COZY_APP_SLUG=photos cozy-scripts build --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs",
"watch": "COZY_APP_SLUG=photos cozy-scripts watch --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs",
"start": "COZY_APP_SLUG=photos cozy-scripts start --manifest src/photos/targets/manifest.webapp --build-dir build/photos --src-dir src/photos --barV7 false --cozyClientJs",
"deploy": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/photos/' --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",
"lint:js": "eslint '{src,test}/**/*.{js,jsx}'",
"testcafe:drive": "node testcafe/runner-drive.js",
"testcafe:photos": "node testcafe/runner-photos.js",
"test": "env NODE_ENV='test' jest",
"genicon:drive:mobile": "(cd src/drive/targets/mobile && rm -Rf ./res/icons ./res/screens && splashicon-generator --imagespath='./res/model' && cp res/model/splash.png res/screens/ios/Default@2x~universal~anyany.png)",
"prepare:drive:mobile": "(cd src/drive/targets/mobile && rm -rf platforms && rm -rf plugins && cordova prepare)",
"run:drive:android": "(cd src/drive/targets/mobile && cordova run android --device )",
"run:drive:android:emulator": "(cd src/drive/targets/mobile && cordova run android --emulator )",
"build:drive:android": "(cd src/drive/targets/mobile && cordova build android --release )",
"build:drive:android:debug": "(cd src/drive/targets/mobile && cordova build android --debug )",
"sign:drive:android": "(cd src/drive/targets/mobile && mkdir -p build/android && apksigner sign --ks keys/android/cozy-drive-release-key.jks --out build/android/cozy-drive.apk platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk)",
"autosign:drive:android": "(cd src/drive/targets/mobile && mkdir -p build/android && apksigner sign --ks keys/android/cozy-drive-release-key.jks --ks-pass env:ANDROID_KEYSTORE_PASS --out build/android/cozy-drive.apk platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk)",
"buildsigned:drive:android": "yarn build:drive:android && yarn sign:drive:android",
"publish:drive:android": "yarn build:drive:mobile && yarn buildsigned:drive:android && (cd src/drive/targets/mobile && fastlane android pushbeta)",
"publishbeta:drive:android": "(cd src/drive/targets/mobile && fastlane android pushbeta)",
"run:drive:ios": "(cd src/drive/targets/mobile && cordova run ios --buildFlag='-UseModernBuildSystem=0' --device)",
"run:drive:ios:emulator": "(cd src/drive/targets/mobile && cordova run ios --buildFlag='-UseModernBuildSystem=0' --emulator)",
"publish:drive:ios": "yarn build:drive:mobile && (cd src/drive/targets/mobile && fastlane ios pushtest)",
"sentry:drive:mobile": "sentry-cli releases -o sentry -p cozy-drive-v3 files $npm_package_version upload-sourcemaps ./src/drive/targets/mobile/www",
"version": "yarn version:drive & yarn version:photos",
"version:drive:manifest": "replace '\\d+\\.\\d+\\.\\d+' $npm_package_version ./src/drive/targets/manifest.webapp",
"version:drive:mobilePackage": "replace '\"version\": \"\\d+\\.\\d+\\.\\d+\"' '\"version\": \"'$npm_package_version'\"' ./src/drive/targets/mobile/package.json",
"version:drive:config": "replace 'version=\"\\d+\\.\\d+\\.\\d+\"' 'version=\"'$npm_package_version'\"' ./src/drive/targets/mobile/config.xml",
"version:drive:iosbuild": "replace 'CFBundleVersion=\"\\d+\\.\\d+\\.\\d+.\\d+\"' 'CFBundleVersion=\"'$npm_package_version'.0\"' ./src/drive/targets/mobile/config.xml",
"version:drive:androidbuild": "perl -pi -e 's,android-versionCode=\"[0-9]+\",android-versionCode=\"'`echo ${npm_package_version} | tr -d .`'0000\",g' ./src/drive/targets/mobile/config.xml",
"version:drive:useragent": "replace 'value=\"(.+)\\d+\\.\\d+\\.\\d+\"' 'value=\"$1'$npm_package_version'\"' ./src/drive/targets/mobile/config.xml",
"version:drive": "npm-run-all --parallel 'version:drive:*'",
"version": "yarn version:photos",
"version:photos": "replace '\\d+\\.\\d+\\.\\d+' $npm_package_version ./src/photos/targets/manifest.webapp",
"service:drive": "yarn cozy-konnector-dev -m src/photos/targets/manifest.webapp",
"service:photos": "yarn cozy-konnector-dev -m src/photos/targets/manifest.webapp"
"service": "yarn cozy-konnector-dev -m src/photos/targets/manifest.webapp"
},
"repository": {
"type": "git",
Expand Down
Loading