From d875411c6c692c141a19ad7ae5466b79eeb235dd Mon Sep 17 00:00:00 2001 From: Olivier Combe Date: Thu, 28 Sep 2023 15:59:39 +0200 Subject: [PATCH] update github workflow for bitdev --- .github/workflows/main.yml | 142 ++++++++++++++++++------------------- scripts/keep-env.js | 6 +- workspace.jsonc | 24 ++++--- 3 files changed, 87 insertions(+), 85 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e87df8be..b34a25ae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v3 - name: Keep default - run: npm i replace-in-file && node scripts/keep-env.js --version=16 --default + run: npm i replace-in-file@6.3.5 && node scripts/keep-env.js --version=16 --default - name: Cleanup node modules run: rm -rf node_modules @@ -36,34 +36,34 @@ jobs: run: bit install --log - name: Remove v15 - run: bit remove versions/angular-v15 -s -f --log + run: bit remove envs/angular-v15-env -s -f --log - name: Remove v15 fork - run: bit remove forks/angular-env-v15 -s -f --log + run: bit remove examples/my-angular-v15-env -s -f --log - name: Remove v14 - run: bit remove versions/angular-v14 -s -f --log + run: bit remove envs/angular-v14-env -s -f --log - name: Remove v14 fork - run: bit remove forks/angular-env-v14 -s -f --log + run: bit remove examples/my-angular-v14-env -s -f --log - name: Remove v13 - run: bit remove versions/angular-v13 -s -f --log + run: bit remove envs/angular-v13-env -s -f --log - name: Remove v13 fork - run: bit remove forks/angular-env-v13 -s -f --log + run: bit remove examples/my-angular-v13-env -s -f --log - name: Remove v12 - run: bit remove versions/angular-v12 -s -f --log + run: bit remove envs/angular-v12-env -s -f --log - name: Remove v12 fork - run: bit remove forks/angular-env-v12 -s -f --log + run: bit remove examples/my-angular-v12-env -s -f --log - name: Add example component - run: bit add examples/demo-lib --log + run: bit add integration/demo-lib --log - name: Add example app - run: bit add examples/demo-app --log + run: bit add integration/demo-app --log - name: Cleanup node modules run: bit cc @@ -113,7 +113,7 @@ jobs: - uses: actions/checkout@v3 - name: Keep v16 - run: npm i replace-in-file && node scripts/keep-env.js --version=16 + run: npm i replace-in-file@6.3.5 && node scripts/keep-env.js --version=16 - name: Cleanup node modules run: rm -rf node_modules @@ -122,37 +122,37 @@ jobs: run: bit install --log - name: Remove default - run: bit remove angular -s -f --log + run: bit remove angular-env -s -f --log - name: Remove default fork - run: bit remove forks/angular-env-default -s -f --log + run: bit remove examples/my-angular-env -s -f --log - name: Remove v15 - run: bit remove versions/angular-v15 -s -f --log + run: bit remove envs/angular-v15-env -s -f --log - name: Remove v15 fork - run: bit remove forks/angular-env-v15 -s -f --log + run: bit remove examples/my-angular-v15-env -s -f --log - name: Remove v14 - run: bit remove versions/angular-v14 -s -f --log + run: bit remove envs/angular-v14-env -s -f --log - name: Remove v14 fork - run: bit remove forks/angular-env-v14 -s -f --log + run: bit remove examples/my-angular-v14-env -s -f --log - name: Remove v13 - run: bit remove versions/angular-v13 -s -f --log + run: bit remove envs/angular-v13-env -s -f --log - name: Remove v13 fork - run: bit remove forks/angular-env-v13 -s -f --log + run: bit remove examples/my-angular-v13-env -s -f --log - name: Remove v12 - run: bit remove versions/angular-v12 -s -f --log + run: bit remove envs/angular-v12-env -s -f --log - name: Remove v12 fork - run: bit remove forks/angular-env-v12 -s -f --log + run: bit remove examples/my-angular-v12-env -s -f --log - name: Add example component - run: bit add examples/demo-lib-v16 --log + run: bit add integration/demo-lib-v16 --log - name: Cleanup node modules run: bit cc @@ -199,7 +199,7 @@ jobs: - uses: actions/checkout@v3 - name: Keep v15 - run: npm i replace-in-file && node scripts/keep-env.js --version=15 + run: npm i replace-in-file@6.3.5 && node scripts/keep-env.js --version=15 - name: Cleanup node modules run: rm -rf node_modules @@ -208,37 +208,37 @@ jobs: run: bit install --log - name: Remove default - run: bit remove angular -s -f --log + run: bit remove angular-env -s -f --log - name: Remove default fork - run: bit remove forks/angular-env-default -s -f --log + run: bit remove examples/my-angular-env -s -f --log - name: Remove v16 - run: bit remove versions/angular-v16 -s -f --log + run: bit remove envs/angular-v16-env -s -f --log - name: Remove v16 fork - run: bit remove forks/angular-env-v16 -s -f --log + run: bit remove examples/my-angular-v16-env -s -f --log - name: Remove v14 - run: bit remove versions/angular-v14 -s -f --log + run: bit remove envs/angular-v14-env -s -f --log - name: Remove v14 fork - run: bit remove forks/angular-env-v14 -s -f --log + run: bit remove examples/my-angular-v14-env -s -f --log - name: Remove v13 - run: bit remove versions/angular-v13 -s -f --log + run: bit remove envs/angular-v13-env -s -f --log - name: Remove v13 fork - run: bit remove forks/angular-env-v13 -s -f --log + run: bit remove examples/my-angular-v13-env -s -f --log - name: Remove v12 - run: bit remove versions/angular-v12 -s -f --log + run: bit remove envs/angular-v12-env -s -f --log - name: Remove v12 fork - run: bit remove forks/angular-env-v12 -s -f --log + run: bit remove examples/my-angular-v12-env -s -f --log - name: Add example component - run: bit add examples/demo-lib-v15 --log + run: bit add integration/demo-lib-v15 --log - name: Cleanup node modules run: bit cc @@ -284,7 +284,7 @@ jobs: - uses: actions/checkout@v3 - name: Keep v14 - run: npm i replace-in-file && node scripts/keep-env.js --version=14 + run: npm i replace-in-file@6.3.5 && node scripts/keep-env.js --version=14 - name: Cleanup node modules run: rm -rf node_modules @@ -293,37 +293,37 @@ jobs: run: bit install --log - name: Remove default - run: bit remove angular -s -f --log + run: bit remove angular-env -s -f --log - name: Remove default fork - run: bit remove forks/angular-env-default -s -f --log + run: bit remove examples/my-angular-env -s -f --log - name: Remove v16 - run: bit remove versions/angular-v16 -s -f --log + run: bit remove envs/angular-v16-env -s -f --log - name: Remove v16 fork - run: bit remove forks/angular-env-v16 -s -f --log + run: bit remove examples/my-angular-v16-env -s -f --log - name: Remove v15 - run: bit remove versions/angular-v15 -s -f --log + run: bit remove envs/angular-v15-env -s -f --log - name: Remove v15 fork - run: bit remove forks/angular-env-v15 -s -f --log + run: bit remove examples/my-angular-v15-env -s -f --log - name: Remove v13 - run: bit remove versions/angular-v13 -s -f --log + run: bit remove envs/angular-v13-env -s -f --log - name: Remove v13 fork - run: bit remove forks/angular-env-v13 -s -f --log + run: bit remove examples/my-angular-v13-env -s -f --log - name: Remove v12 - run: bit remove versions/angular-v12 -s -f --log + run: bit remove envs/angular-v12-env -s -f --log - name: Remove v12 fork - run: bit remove forks/angular-env-v12 -s -f --log + run: bit remove examples/my-angular-v12-env -s -f --log - name: Add example component - run: bit add examples/demo-lib-v14 --log + run: bit add integration/demo-lib-v14 --log - name: Cleanup node modules run: bit cc @@ -369,7 +369,7 @@ jobs: - uses: actions/checkout@v3 - name: Keep v13 - run: npm i replace-in-file && node scripts/keep-env.js --version=13 + run: npm i replace-in-file@6.3.5 && node scripts/keep-env.js --version=13 - name: Cleanup node modules run: rm -rf node_modules @@ -378,37 +378,37 @@ jobs: run: bit install --log - name: Remove default - run: bit remove angular -s -f --log + run: bit remove angular-env -s -f --log - name: Remove default fork - run: bit remove forks/angular-env-default -s -f --log + run: bit remove examples/my-angular-env -s -f --log - name: Remove v16 - run: bit remove versions/angular-v16 -s -f --log + run: bit remove envs/angular-v16-env -s -f --log - name: Remove v16 fork - run: bit remove forks/angular-env-v16 -s -f --log + run: bit remove examples/my-angular-v16-env -s -f --log - name: Remove v15 - run: bit remove versions/angular-v15 -s -f --log + run: bit remove envs/angular-v15-env -s -f --log - name: Remove v15 fork - run: bit remove forks/angular-env-v15 -s -f --log + run: bit remove examples/my-angular-v15-env -s -f --log - name: Remove v14 - run: bit remove versions/angular-v14 -s -f --log + run: bit remove envs/angular-v14-env -s -f --log - name: Remove v14 fork - run: bit remove forks/angular-env-v14 -s -f --log + run: bit remove examples/my-angular-v14-env -s -f --log - name: Remove v12 - run: bit remove versions/angular-v12 -s -f --log + run: bit remove envs/angular-v12-env -s -f --log - name: Remove v12 fork - run: bit remove forks/angular-env-v12 -s -f --log + run: bit remove examples/my-angular-v12-env -s -f --log - name: Add example component - run: bit add examples/demo-lib-v13 --log + run: bit add integration/demo-lib-v13 --log - name: Cleanup node modules run: bit cc @@ -455,7 +455,7 @@ jobs: - uses: actions/checkout@v3 - name: Keep v12 - run: npm i replace-in-file && node scripts/keep-env.js --version=12 + run: npm i replace-in-file@6.3.5 && node scripts/keep-env.js --version=12 - name: Cleanup node modules run: rm -rf node_modules @@ -464,37 +464,37 @@ jobs: run: bit install --log - name: Remove default - run: bit remove angular -s -f --log + run: bit remove angular-env -s -f --log - name: Remove default fork - run: bit remove forks/angular-env-default -s -f --log + run: bit remove examples/my-angular-env -s -f --log - name: Remove v16 - run: bit remove versions/angular-v16 -s -f --log + run: bit remove envs/angular-v16-env -s -f --log - name: Remove v16 fork - run: bit remove forks/angular-env-v16 -s -f --log + run: bit remove examples/my-angular-v16-env -s -f --log - name: Remove v15 - run: bit remove versions/angular-v15 -s -f --log + run: bit remove envs/angular-v15-env -s -f --log - name: Remove v15 fork - run: bit remove forks/angular-env-v15 -s -f --log + run: bit remove examples/my-angular-v15-env -s -f --log - name: Remove v14 - run: bit remove versions/angular-v14 -s -f --log + run: bit remove envs/angular-v14-env -s -f --log - name: Remove v14 fork - run: bit remove forks/angular-env-v14 -s -f --log + run: bit remove examples/my-angular-v14-env -s -f --log - name: Remove v13 - run: bit remove versions/angular-v13 -s -f --log + run: bit remove envs/angular-v13-env -s -f --log - name: Remove v13 fork - run: bit remove forks/angular-env-v13 -s -f --log + run: bit remove examples/my-angular-v13-env -s -f --log - name: Add example component - run: bit add examples/demo-lib-v12 --log + run: bit add integration/demo-lib-v12 --log - name: Cleanup node modules run: bit cc diff --git a/scripts/keep-env.js b/scripts/keep-env.js index 03b6c3cc..321f7bcc 100644 --- a/scripts/keep-env.js +++ b/scripts/keep-env.js @@ -19,13 +19,13 @@ const argv = key => { const regexp = []; // Remove all versions but this one const version = parseInt(argv('version')); -regexp.push(new RegExp(`\\s\\s"teambit\\.angular\\/versions\\/angular\\-v(?!${version})\\d\\d?":\\s\\{\\},\\n`, "g")); +regexp.push(new RegExp(`\\s\\s"bitdev\\.angular\\/envs\\/angular\\-v(?!${version})\\d\\d?\\-env":\\s\\{\\},\\n`, "g")); const defaultEnv = argv('default'); // Remove default env & app if needed if(!defaultEnv) { - regexp.push(new RegExp(`\\s\\s"teambit\\.angular\\/angular":\\s\\{\\},\\n`, "g")); - regexp.push(new RegExp(`\\s\\s"examples\\/demo-app":\\s\\{\\},\\n`, "g")); + regexp.push(new RegExp(`\\s\\s"bitdev\\.angular\\/angular\\-env":\\s\\{\\},\\n`, "g")); + regexp.push(new RegExp(`\\s\\s"integration\\/demo-app":\\s\\{\\},\\n`, "g")); } try { diff --git a/workspace.jsonc b/workspace.jsonc index 7fed5ce1..c20da6aa 100644 --- a/workspace.jsonc +++ b/workspace.jsonc @@ -77,20 +77,22 @@ }, "teambit.generator/generator": { "envs": [ - // "bitdev.angular/angular-env", - "bitdev.angular/envs/angular-v16-env" - // "bitdev.angular/envs/angular-v15-env", - // "bitdev.angular/envs/angular-v14-env", - // "bitdev.angular/envs/angular-v13-env", - // "bitdev.angular/envs/angular-v12-env", + "bitdev.angular/angular-env", + "bitdev.angular/envs/angular-v16-env", + "bitdev.angular/envs/angular-v15-env", + "bitdev.angular/envs/angular-v14-env", + "bitdev.angular/envs/angular-v13-env", + "bitdev.angular/envs/angular-v12-env", ] }, - // "bitdev.angular/envs/angular-v15-env": {}, - // "bitdev.angular/envs/angular-v14-env": {}, - // "bitdev.angular/envs/angular-v13-env": {}, - // "bitdev.angular/envs/angular-v12-env": {}, + "bitdev.angular/angular-env": {}, + "bitdev.angular/envs/angular-v16-env": {}, + "bitdev.angular/envs/angular-v15-env": {}, + "bitdev.angular/envs/angular-v14-env": {}, + "bitdev.angular/envs/angular-v13-env": {}, + "bitdev.angular/envs/angular-v12-env": {}, // Add angular apps (until this is no longer necessary) -// "integration/demo-app": {}, + "integration/demo-app": {}, /** * workspace variants allow you to set different subsets of configuration for components in your workspace. * this is extremely useful for upgrading, aligning and building components with a