Skip to content

Commit

Permalink
[INF-484] Remove postinstall builds (#6381)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype authored Oct 18, 2023
1 parent 8387f1b commit 492a51a
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 160 deletions.
9 changes: 0 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ jobs:
- ./packages/libs/node_modules
- ./packages/identity-service/node_modules

- save_cache:
key: cache-{{ .Revision }}
paths:
- ./packages/stems/dist
- ./packages/harmony/dist
- ./packages/common/dist
- ./packages/libs/dist
- ./packages/spl/dist

generate-release:
working_directory: ~/audius-protocol
resource_class: small
Expand Down
10 changes: 4 additions & 6 deletions .circleci/src/commands/@common-commands.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
common-lint:
description: "lint @audius/common"
description: 'lint @audius/common'
steps:
- run:
name: "lint @audius/common"
command: |
cd packages/common
npm run lint
- run:
name: 'lint @audius/common'
command: npx turbo run lint --filter=@audius/common
11 changes: 10 additions & 1 deletion .circleci/src/commands/@mobile-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ mobile-prepare-ios:
command: |
curl -sL https://sentry.io/get-cli/ | bash
echo export SENTRY_BINARY=/usr/local/bin/sentry-cli >> "$BASH_ENV"
- run:
name: Build dependencies
command: npx turbo run build --filter=audius-mobile-client
- run:
name: create bundle
command: cd packages/mobile && npm run bundle:ios
command: cd packages/mobile && npx turbo run bundle:ios
- run:
name: update fastlane
command: cd packages/mobile/ios && sudo bundle update fastlane
Expand Down Expand Up @@ -142,6 +145,9 @@ mobile-prepare-android:
- run:
name: update fastlane
command: cd packages/mobile/android && sudo bundle update fastlane
- run:
name: Build dependencies
command: npx turbo run build --filter=audius-mobile-client
- run:
name: fetch app fastlane json config to upload to play store
command: |
Expand Down Expand Up @@ -230,6 +236,9 @@ mobile-release-saga-dapp-store:
corepack enable --install-directory ~/bin
corepack prepare pnpm@`npm info pnpm --json | jq -r .version` --activate
pnpm install
- run:
name: Build dependencies
command: npx turbo run build --filter=audius-mobile-client
- run:
name: Install solana
command: |
Expand Down
4 changes: 0 additions & 4 deletions .circleci/src/jobs/@embed-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ embed-init:
keys:
- cache-{{ checksum "package-lock.json" }}-{{ checksum "combined-patch-file.txt" }}

- restore_cache:
keys:
- cache-{{ .Revision }}

- persist_to_workspace:
root: ./
paths:
Expand Down
4 changes: 0 additions & 4 deletions .circleci/src/jobs/@identity-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ identity-init:
keys:
- cache-{{ checksum "package-lock.json" }}-{{ checksum "combined-patch-file.txt" }}

- restore_cache:
keys:
- cache-{{ .Revision }}

- run:
name: verify
command: npx turbo run verify --filter=identity-service
Expand Down
9 changes: 3 additions & 6 deletions .circleci/src/jobs/@mobile-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ mobile-init:
- common-lint

- run:
name: typecheck
command: cd packages/mobile && npm run typecheck

- run:
name: lint
command: cd packages/mobile && npm run lint
name: lint & typecheck
command: |
npx turbo run verify --filter=audius-mobile-client
- persist_to_workspace:
root: ./
Expand Down
20 changes: 4 additions & 16 deletions .circleci/src/jobs/@web-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,17 @@ web-init:
keys:
- cache-{{ checksum "package-lock.json" }}-{{ checksum "combined-patch-file.txt" }}

- restore_cache:
keys:
- cache-{{ .Revision }}

- common-lint

- run:
name: typecheck
name: lint & typecheck
command: |
cd packages/web
npm run typecheck
- run:
name: lint
command: |
cd packages/web
npm run lint
npx turbo run verify --filter=audius-client
- run:
name: stylelint
command: |
cd packages/web
npm run stylelint
npm run stylelint -w audius-client
- persist_to_workspace:
root: ./
Expand Down Expand Up @@ -70,7 +58,7 @@ web-build-demo:
command: |
cd packages/web
export PUBLIC_URL=/${CIRCLE_BRANCH}
CI=false npm run build:stage
CI=false npm run build:stage -w audius-client
mv build-staging build-demo
- persist_to_workspace:
root: ./
Expand Down
10 changes: 9 additions & 1 deletion .circleci/src/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
when: << pipeline.parameters.run-web-workflow >>
jobs:
- web-init
- web-init:
context:
- Vercel

# Cut a demo if not main
- web-build-demo:
context:
- Vercel
requires:
- web-init
filters:
Expand All @@ -19,9 +23,13 @@ jobs:

# Build
- web-build-staging:
context:
- Vercel
requires:
- web-init
- web-build-production:
context:
- Vercel
requires:
- web-init
filters:
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
],
"private": true,
"scripts": {
"build": "turbo run build --filter=audius-client^... --filter=audius-mobile-client^... --filter=identity-service^...",
"build": "turbo run build",
"check-secrets": "sh ./scripts/check_secrets.sh",
"clean:modules": "rm -rf node_modules && rm -rf packages/*/node_modules",
"clean:dist": "rm -rf packages/*/dist",
"clean": "npm run clean:auto -w audius-mobile-client && npm run clean:modules",
"install-hooks": "mookme init --only-hook --skip-types-selection",
"install-packages": "SKIP_BUILD=true npm install",
"lint:fix": "turbo run lint:fix",
"lint": "turbo run lint",
"patch-package": "patch-package --patch-dir=packages/mobile/patches && patch-package --patch-dir=packages/web/patches && patch-package --patch-dir=packages/identity-service/patches",
Expand All @@ -22,21 +22,21 @@
"turbo-link": "turbo login && turbo link",
"verify": "turbo run verify",
"WEB========================================": "",
"web:dev": "turbo run start:dev --filter=audius-client",
"web:prod": "turbo run start:prod --filter=audius-client",
"web:stage": "turbo run start:stage --filter=audius-client",
"web:dev": "npm run start:dev -w audius-client",
"web:prod": "npm run start:prod -w audius-client",
"web:stage": "npm run start:stage -w audius-client",
"DESKTOP====================================": "",
"desktop:dev": "concurrently -k 'BROWSER=none turbo run start:dev --filter=audius-client' 'wait-on http://localhost:3000 && npm run electron:localhost -w audius-client -- 3000'",
"desktop:prod": "concurrently -k 'BROWSER=none turbo run start:prod --filter=audius-client' 'wait-on http://localhost:3002 && npm run electron:localhost -w audius-client -- 3002'",
"desktop:stage": "concurrently -k 'BROWSER=none turbo run start:stage --filter=audius-client' 'wait-on http://localhost:3001 && npm run electron:localhost -w audius-client -- 3001'",
"MOBILE=====================================": "",
"android:dev": "turbo run android:dev --filter=audius-mobile-client",
"android:prod": "turbo run android:prod --filter=audius-mobile-client",
"android:stage": "turbo run android:stage --filter=audius-mobile-client",
"android:dev": "npm run android:dev -w audius-mobile-client",
"android:prod": "npm run android:prod -w audius-mobile-client",
"android:stage": "npm run android:stage -w audius-mobile-client",
"clear-cache": "watchman watch-del-all && npm run start -w audius-mobile-client --reset-cache",
"ios:dev": "turbo run ios:dev --filter=audius-mobile-client",
"ios:prod": "turbo run ios:prod --filter=audius-mobile-client",
"ios:stage": "turbo run ios:stage --filter=audius-mobile-client",
"ios:dev": "npm run ios:dev -w audius-mobile-client",
"ios:prod": "npm run ios:prod -w audius-mobile-client",
"ios:stage": "npm run ios:stage -w audius-mobile-client",
"mobile": "npm run start -w audius-mobile-client",
"COMMON=====================================": "",
"common": "turbo run start --filter=@audius/common",
Expand Down
2 changes: 1 addition & 1 deletion packages/commands/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/package-lock.json ./package-lock.json
COPY --from=builder /app/scripts ./scripts

RUN CI=true npm run install-packages
RUN CI=true npm i

# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ COPY --from=builder /app/out/package-lock.json ./package-lock.json
COPY --from=builder /app/scripts ./scripts

RUN echo "installing deps for ${APP_NAME}"
RUN CI=true npm run install-packages
RUN CI=true npm i

# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
Expand Down
2 changes: 1 addition & 1 deletion packages/identity-service/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ COPY --from=builder /app/out/package-lock.json ./package-lock.json
COPY --from=builder /app/scripts ./scripts
COPY --from=builder /app/packages/identity-service/patches ./packages/identity-service/patches

RUN CI=true npm run install-packages
RUN CI=true npm i

# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
Expand Down
2 changes: 1 addition & 1 deletion packages/libs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/package-lock.json ./package-lock.json
COPY --from=builder /app/scripts ./scripts

RUN CI=true npm run install-packages
RUN CI=true npm i

# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
Expand Down
24 changes: 13 additions & 11 deletions packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
"private": true,
"scripts": {
"jetifier": "jetifier",
"android:dev": "ENVFILE=.env.dev react-native run-android --variant=prodDebug",
"android:stage": "ENVFILE=.env.stage react-native run-android --variant=stagingDebug --appIdSuffix staging",
"android:prod": "ENVFILE=.env.prod react-native run-android --variant=prodDebug",
"android:release": "ENVFILE=.env.prod react-native run-android --variant=prodRelease",
"ios:dev": "react-native run-ios --scheme 'Dev' --simulator \"iPhone 14 Pro\"",
"ios:stage": "react-native run-ios --scheme 'Staging' --configuration Staging.Debug --simulator \"iPhone 14 Pro\"",
"ios:prod": "react-native run-ios --simulator \"iPhone 14 Pro\"",
"ios:release": "react-native run-ios --simulator \"iPhone 14 Pro\" --configuration Release",
"ios:device:dev": "react-native run-ios --scheme 'Dev' --device",
"ios:device:stage": "react-native run-ios --scheme 'Staging' --configuration Staging.Debug --device",
"ios:device:prod": "react-native run-ios --device",
"android": "react-native run-android",
"android:dev": "ENVFILE=.env.dev turbo run android -- --variant=prodDebug",
"android:stage": "ENVFILE=.env.stage turbo run android -- --variant=stagingDebug --appIdSuffix staging",
"android:prod": "ENVFILE=.env.prod turbo run android -- --variant=prodDebug",
"android:release": "ENVFILE=.env.prod turbo run android -- --variant=prodRelease",
"ios": "react-native run-ios",
"ios:dev": "turbo run ios -- --scheme 'Dev' --simulator \"iPhone 14 Pro\"",
"ios:stage": "turbo run ios -- --scheme 'Staging' --configuration Staging.Debug --simulator \"iPhone 14 Pro\"",
"ios:prod": "turbo run ios -- --simulator \"iPhone 14 Pro\"",
"ios:release": "turbo run ios -- --simulator \"iPhone 14 Pro\" --configuration Release",
"ios:device:dev": "turbo run ios -- --scheme 'Dev' --device",
"ios:device:stage": "turbo run ios -- --scheme 'Staging' --configuration Staging.Debug --device",
"ios:device:prod": "turbo run ios -- --device",
"ios:update-signing-cert": "cd ios && fastlane match development -a co.audius.audiusmusic,co.audius.audiusmusic.staging && cd ..",
"bundle:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
"build:e2e": "detox build --configuration ios.sim.debug",
Expand Down
22 changes: 22 additions & 0 deletions packages/mobile/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": ["//"],
"pipeline": {
"android": {
"dependsOn": ["^build"],
"cache": false,
"persistent": true,
"outputMode": "new-only"
},
"ios": {
"dependsOn": ["^build"],
"cache": false,
"persistent": true,
"outputMode": "new-only"
},
"bundle:ios": {
"outputs": ["./ios/main.jsbundle"],
"dependsOn": ["^build"],
"outputMode": "new-only"
}
}
}
43 changes: 22 additions & 21 deletions packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"scripts": {
"publish-scripts": "./scripts/publishScripts.sh",
"start": "craco --max-old-space-size=12288 start",
"start:dev": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.dev npm start",
"start:stage": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage npm start",
"start:prod": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.prod env-cmd ./.env/.env.source-maps npm start",
"start:dev": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.dev turbo run start",
"start:stage": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage turbo run start",
"start:prod": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.prod env-cmd ./.env/.env.source-maps turbo run start",
"prebuild": "npm run publish-scripts",
"build": "craco --max-old-space-size=12288 build && cp package.json build/package.json",
"build:dev": "npm run write-sha && env-cmd ./.env/.env.git env-cmd ./.env/.env.dev npm run build && rm -rf build-development && mv build build-development",
"build:stage": "npm run write-sha && env-cmd ./.env/.env.git env-cmd ./.env/.env.stage npm run build && rm -rf build-staging && mv build build-staging",
"build:prod": "npm run write-sha && env-cmd ./.env/.env.git env-cmd ./.env/.env.prod npm run build && rm -rf build-production && mv build build-production",
"build:prod-source-maps": "npm run write-sha && env-cmd ./.env/.env.git env-cmd ./.env/.env.prod env-cmd ./.env/.env.source-maps npm run build && rm -rf build-production && mv build build-production",
"build:dev": "npm run write-sha && env-cmd ./.env/.env.git env-cmd ./.env/.env.dev turbo run build && rm -rf build-development && mv build build-development",
"build:stage": "npm run write-sha && env-cmd ./.env/.env.git env-cmd ./.env/.env.stage turbo run build && rm -rf build-staging && mv build build-staging",
"build:prod": "npm run write-sha && env-cmd ./.env/.env.git env-cmd ./.env/.env.prod turbo run build && rm -rf build-production && mv build build-production",
"build:prod-source-maps": "npm run write-sha && env-cmd ./.env/.env.git env-cmd ./.env/.env.prod env-cmd ./.env/.env.source-maps turbo run build && rm -rf build-production && mv build build-production",
"test": "craco test --resetMocks=false",
"test:coverage": "craco test --resetMocks=false --coverage --watchAll=false",
"eject": "react-scripts eject",
Expand All @@ -28,20 +28,21 @@
"electron:prod": "electron . production",
"electron:localhost": "electron . localhost",
"pack": "electron-builder --dir",
"dist": "node ./scripts/dist.js --mac --win --linux",
"dist:mac": "node ./scripts/dist.js --mac",
"dist:win": "node ./scripts/dist.js --win",
"dist:linux": "node ./scripts/dist.js --linux",
"dist-publish": "node ./scripts/dist.js --mac --win --linux --publish always",
"dist-publish-production": "node ./scripts/dist.js --mac --win --linux --publish always --env production",
"dist:mac-publish": "node ./scripts/dist.js --mac --publish always",
"dist:win-publish": "node ./scripts/dist.js --win --publish always",
"dist:linux-publish": "node ./scripts/dist.js --linux --publish always",
"dist:win:linux-publish": "node ./scripts/dist.js --win --linux --publish always",
"dist:mac-publish-production": "node ./scripts/dist.js --mac --publish always --env production",
"dist:win-publish-production": "node ./scripts/dist.js --win --publish always --env production",
"dist:linux-publish-production": "node ./scripts/dist.js --linux --publish always --env production",
"dist:win:linux-publish-production": "node ./scripts/dist.js --win --linux --publish always --env production",
"dist": "node ./scripts/dist.js",
"dist:all": "turbo run dist -- --mac --win --linux",
"dist:mac": "turbo run dist -- --mac",
"dist:win": "turbo run dist -- --win",
"dist:linux": "turbo run dist -- --linux",
"dist-publish": "turbo run dist -- --mac --win --linux --publish always",
"dist-publish-production": "turbo run dist -- --mac --win --linux --publish always --env production",
"dist:mac-publish": "turbo run dist -- --mac --publish always",
"dist:win-publish": "turbo run dist -- --win --publish always",
"dist:linux-publish": "turbo run dist -- --linux --publish always",
"dist:win:linux-publish": "turbo run dist -- --win --linux --publish always",
"dist:mac-publish-production": "turbo run dist -- --mac --publish always --env production",
"dist:win-publish-production": "turbo run dist -- --win --publish always --env production",
"dist:linux-publish-production": "turbo run dist -- --linux --publish always --env production",
"dist:win:linux-publish-production": "turbo run dist -- --win --linux --publish always --env production",
"write-sha": "./scripts/writeSHA.sh",
"analyze": "source-map-explorer build-production/static/js/*.js",
"analyzeBundle": "env-cmd ./.env/.env.bundle npm run build:prod",
Expand Down
23 changes: 23 additions & 0 deletions packages/web/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": ["//"],
"pipeline": {
"build": {
"outputs": [
"build-development/**",
"build-staging/**",
"build-production/**"
],
"cache": false,
"persistent": true,
"dependsOn": ["^build"],
"outputMode": "new-only"
},
"dist": {
"outputs": ["dist/**"],
"cache": false,
"persistent": true,
"dependsOn": ["^build"],
"outputMode": "new-only"
}
}
}
Loading

0 comments on commit 492a51a

Please sign in to comment.