Skip to content

Commit

Permalink
update github workflow for bitdev
Browse files Browse the repository at this point in the history
  • Loading branch information
ocombe committed Sep 28, 2023
1 parent 9753843 commit d875411
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 85 deletions.
142 changes: 71 additions & 71 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/keep-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
24 changes: 13 additions & 11 deletions workspace.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d875411

Please sign in to comment.