Skip to content

Commit 822a7b3

Browse files
committed
chore: create libs
1 parent 8e654cd commit 822a7b3

File tree

1 file changed

+69
-47
lines changed

1 file changed

+69
-47
lines changed

.github/workflows/comment-diffs.yml

Lines changed: 69 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@v3
1919

20-
- name: Test export
21-
run: |
22-
source ./.github/workflows/configMatrix.sh
23-
for libraryType in "${libraryTypes[@]}"; do
24-
for language in "${languages[@]}"; do
25-
if [[ ! "${exclude[*]}" =~ ${libraryType}/${language} ]]; then
26-
echo "$libraryType" "$language"
27-
fi
28-
done
29-
done
30-
3120
- name: Setup
3221
uses: ./.github/actions/setup
3322

@@ -37,21 +26,38 @@ jobs:
3726
3827
- name: Create old version libraries
3928
run: |
29+
# Source all the configuration values to load $languages, $types, and $exclude
4030
source ./.github/workflows/configMatrix.sh
41-
echo "$languages"
42-
43-
./packages/create-react-native-library/bin/create-react-native-library new-version \
44-
--slug @bob/react-native-test \
45-
--description test \
46-
--author-name test \
47-
--author-email test@test \
48-
--author-url https://test.test \
49-
--repo-url https://test.test \
50-
--type ${{ matrix.type }} \
51-
--languages ${{ matrix.language }} \
52-
--no-example \
53-
--no-local \
54-
--react-native-version 0.73.0-rc.2
31+
32+
create_library() {
33+
library_type=$1
34+
language=$2
35+
36+
echo "Generating $library_type/$language"
37+
path_prefix="../test/$library_type/$language"
38+
target_path="$path_prefix/new-version"
39+
40+
npx create-react-native-library "$target_path" \
41+
--slug @bob/react-native-test \
42+
--description test \
43+
--author-name test \
44+
--author-email test@test \
45+
--author-url https://test.test \
46+
--repo-url https://test.test \
47+
--type "$library_type" \
48+
--languages "$language" \
49+
--no-example \
50+
--no-local \
51+
--react-native-version 0.73.0-rc.2
52+
}
53+
54+
for library_type in "${libraryTypes[@]}"; do
55+
for language in "${languages[@]}"; do
56+
if [[ ! "${exclude[*]}" =~ ${library_type}/${language} ]]; then
57+
create_library "$library_type" "$language"
58+
fi
59+
done
60+
done
5561
5662
- name: Fetch main
5763
run: git fetch origin main
@@ -69,32 +75,48 @@ jobs:
6975
7076
- name: Create library again
7177
run: |
72-
./packages/create-react-native-library/bin/create-react-native-library old-version \
73-
--slug @bob/react-native-test \
74-
--description test \
75-
--author-name test \
76-
--author-email test@test \
77-
--author-url https://test.test \
78-
--repo-url https://test.test \
79-
--type ${{ matrix.type }} \
80-
--languages ${{ matrix.language }} \
81-
--no-example \
82-
--no-local \
83-
--react-native-version 0.73.0-rc.2
84-
85-
- name: Set Diff view branch prefix env
86-
run: |
87-
BRANCH_PREFIX="${{ github.event.number }}-${{ matrix.type }}-${{ matrix.language }}"
88-
echo "OLD_VERSION_BRANCH=$BRANCH_PREFIX-old-version" >> $GITHUB_ENV
89-
echo "NEW_VERSION_BRANCH=$BRANCH_PREFIX-new-version" >> $GITHUB_ENV
78+
# Source all the configuration values to load $languages, $types, and $exclude
79+
source ./.github/workflows/configMatrix.sh
9080
91-
- uses: webfactory/[email protected]
92-
with:
93-
ssh-private-key: ${{ secrets.SSH_DEPLOY_KEY }}
81+
create_library() {
82+
library_type=$1
83+
language=$2
84+
85+
echo "Running $library_type/$language"
86+
path_prefix="../test/$library_type/$language"
87+
target_path="$path_prefix/old-version"
88+
89+
npx create-react-native-library "$target_path" \
90+
--slug @bob/react-native-test \
91+
--description test \
92+
--author-name test \
93+
--author-email test@test \
94+
--author-url https://test.test \
95+
--repo-url https://test.test \
96+
--type "$library_type" \
97+
--languages "$language" \
98+
--no-example \
99+
--no-local \
100+
--react-native-version 0.73.0-rc.2
101+
}
102+
103+
for library_type in "${libraryTypes[@]}"; do
104+
for language in "${languages[@]}"; do
105+
if [[ ! "${exclude[*]}" =~ ${library_type}/${language} ]]; then
106+
create_library "$library_type" "$language"
107+
fi
108+
done
109+
done
110+
111+
cd ..
112+
echo "$PWD"
113+
114+
# - uses: webfactory/[email protected]
115+
# with:
116+
# ssh-private-key: ${{ secrets.SSH_DEPLOY_KEY }}
94117

95118
- name: Create the Differ repo
96119
run: |
97-
echo ${{ vars.DIFF_VIEW_SSH }}
98120
mkdir differ
99121
cd differ
100122
git init

0 commit comments

Comments
 (0)