Skip to content

Commit 865b8b5

Browse files
Merge remote-tracking branch 'origin/dev' into refactor/ContentHero-content-adjustments
2 parents 3025455 + 7c08c0c commit 865b8b5

File tree

141 files changed

+62764
-382189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+62764
-382189
lines changed

.all-contributorsrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11774,7 +11774,8 @@
1177411774
"profile": "https://github.com/HayattiQ",
1177511775
"contributions": [
1177611776
"content",
11777-
"bug"
11777+
"bug",
11778+
"maintenance"
1177811779
]
1177911780
},
1178011781
{
@@ -11948,6 +11949,15 @@
1194811949
"contributions": [
1194911950
"maintenance"
1195011951
]
11952+
},
11953+
{
11954+
"login": "sogobanwo",
11955+
"name": "sogobanwo",
11956+
"avatar_url": "https://avatars.githubusercontent.com/u/99739569?v=4",
11957+
"profile": "https://olorunsogo-portfolio-sand.vercel.app/",
11958+
"contributions": [
11959+
"maintenance"
11960+
]
1195111961
}
1195211962
],
1195311963
"contributorsPerLine": 7,

.github/workflows/build-crowdin.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Crowdin project
2+
3+
on:
4+
schedule:
5+
- cron: "20 04 1 * *" # Runs at 4:20 AM on the first day of every month
6+
workflow_dispatch:
7+
8+
jobs:
9+
trigger_crowdin_project_build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
20+
- name: Install dependencies
21+
run: yarn install
22+
23+
- name: Install ts-node
24+
run: yarn global add ts-node
25+
26+
- name: Run script
27+
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/triggerBuild.ts
28+
env:
29+
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
30+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Generate Crowdin translation review report
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
generate_report:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out code
11+
uses: actions/checkout@v3
12+
13+
- name: Set up Node.js
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
18+
- name: Install dependencies
19+
run: yarn install
20+
21+
- name: Install ts-node
22+
run: yarn global add ts-node
23+
24+
- name: Run script
25+
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/reports/generateReviewReport.ts
26+
env:
27+
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
28+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
29+
30+
- name: Upload output as artifact
31+
uses: actions/upload-artifact@v2
32+
with:
33+
name: output
34+
path: ./src/data/crowdin/bucketsAwaitingReviewReport.csv

.github/workflows/get-crowdin-contributors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
create_pr:
9+
get_data_and_create_pr:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out code
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Update Crowdin leaderboard data
2+
3+
on:
4+
schedule:
5+
- cron: "20 16 1 * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
get_data_and_create_pr:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
20+
- name: Install dependencies
21+
run: yarn install
22+
23+
- name: Install ts-node
24+
run: yarn global add ts-node
25+
26+
- name: Set up git
27+
run: |
28+
git config --global user.email "[email protected]"
29+
git config --global user.name "GitHub Action"
30+
31+
- name: Generate timestamp and readable date
32+
id: date
33+
run: |
34+
echo "TIMESTAMP=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
35+
echo "READABLE_DATE=$(date +'%B %-d')" >> $GITHUB_ENV
36+
37+
- name: Fetch latest dev and create new branch
38+
run: |
39+
git fetch origin dev
40+
git checkout -b "automated-update-${{ env.TIMESTAMP }}" origin/dev
41+
42+
- name: Run script
43+
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/leaderboard/getLeaderboardReports.ts
44+
env:
45+
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
46+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
47+
48+
- name: Commit and push
49+
run: |
50+
git add -A
51+
git commit -m "Update Crowdin leaderboard data"
52+
git push origin "automated-update-${{ env.TIMESTAMP }}"
53+
54+
- name: Create PR body
55+
run: |
56+
echo "This PR was automatically created to update Crowdin leaderboard data." > pr_body.txt
57+
echo "This workflows runs on the first of each month at 16:20 (UTC)." >> pr_body.txt
58+
echo "" >> pr_body.txt
59+
echo "Thank you to everyone contributing to translate ethereum.org ❤️" >> pr_body.txt
60+
61+
- name: Create Pull Request
62+
run: |
63+
gh auth login --with-token ${{ secrets.GITHUB_TOKEN }}
64+
gh pr create --base dev --head "automated-update-${{ env.TIMESTAMP }}" --title "Update translation leaderboard data from Crowdin - ${{ env.READABLE_DATE }}" --body-file pr_body.txt

.github/workflows/get-translation-progress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
create_pr:
9+
get_data_and_create_pr:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out code
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Import Crowdin translations
2+
3+
on:
4+
schedule:
5+
- cron: "20 16 1 * *" # Runs at 4:20 PM on the first day of every month
6+
workflow_dispatch:
7+
8+
jobs:
9+
import_crowdin_and_create_prs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
20+
- name: Install dependencies
21+
run: yarn install
22+
23+
- name: Install ts-node
24+
run: yarn global add ts-node
25+
26+
- name: Set up git
27+
run: |
28+
git config --global user.email "[email protected]"
29+
git config --global user.name "GitHub Action"
30+
31+
- name: Fetch latest dev
32+
run: git fetch origin dev
33+
34+
- name: Get translations
35+
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/getTranslations.ts
36+
env:
37+
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
38+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
39+
40+
- name: Authenticate GitHub CLI
41+
run: |
42+
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
43+
44+
- name: Process commits and post PRs by language
45+
run: npx ts-node -O '{"module":"commonjs"}' ./src/scripts/crowdin/translations/postLangPRs.ts
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/import-community-events.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
create_pr:
9+
get_data_and_create_pr:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out code

.github/workflows/lighthouse-ci.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Lighthouse CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- staging
8+
- performance/**
9+
10+
jobs:
11+
lighthouse:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
pull-requests: write
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Sleep for 60 minutes
20+
run: sleep 3600
21+
- name: Wait for Netlify Deploy
22+
id: netlify_deploy
23+
uses: probablyup/[email protected]
24+
with:
25+
site_id: "e8f2e766-888b-4954-8500-1b647d84db99"
26+
max_timeout: 900
27+
env:
28+
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
29+
- name: Audit URLs using Lighthouse
30+
id: lighthouse_audit
31+
uses: treosh/lighthouse-ci-action@v11
32+
with:
33+
urls: |
34+
${{ steps.netlify_deploy.outputs.url }}/en/
35+
${{ steps.netlify_deploy.outputs.url }}/en/wallets/find-wallet/
36+
${{ steps.netlify_deploy.outputs.url }}/en/staking/
37+
${{ steps.netlify_deploy.outputs.url }}/en/whitepaper/
38+
${{ steps.netlify_deploy.outputs.url }}/en/nft/
39+
${{ steps.netlify_deploy.outputs.url }}/en/developers/docs/intro-to-ethereum/
40+
${{ steps.netlify_deploy.outputs.url }}/en/developers/tutorials/creating-a-wagmi-ui-for-your-contract/
41+
runs: 3 # run three times
42+
uploadArtifacts: true # save results as an action artifacts
43+
temporaryPublicStorage: true # upload lighthouse report to the temporary storage
44+
- name: Format lighthouse score
45+
id: format_lighthouse_score
46+
uses: actions/github-script@v3
47+
with:
48+
github-token: ${{ secrets.GITHUB_TOKEN }}
49+
script: |
50+
const manifests = ${{ steps.lighthouse_audit.outputs.manifest }};
51+
const links = ${{ steps.lighthouse_audit.outputs.links }};
52+
const formatResult = (res) => Math.round((res * 100));
53+
54+
console.log('Total manifests:', manifests.length);
55+
console.log('Manifests:', JSON.stringify(manifests, null, 2));
56+
console.log('Links:', JSON.stringify(links, null, 2));
57+
58+
let comment = [
59+
'| Page | Performance | Accessibility | Best practices | SEO | PWA |',
60+
'| --- | --- | --- | --- | --- | --- |',
61+
];
62+
63+
Object.entries(links).forEach(([pageUrl, reportUrl]) => {
64+
const relevantManifests = manifests.filter(manifest => manifest.url === pageUrl);
65+
const results = relevantManifests.map(manifest => manifest.summary);
66+
const averagedResults = {};
67+
68+
if (results.length > 0) {
69+
Object.keys(results[0]).forEach(key => {
70+
averagedResults[key] = formatResult(
71+
results.reduce((acc, cur) => acc + cur[key], 0) / results.length
72+
);
73+
});
74+
75+
const score = res => res >= 90 ? '🟢' : res >= 50 ? '🟠' : '🔴';
76+
const urlForTable = pageUrl.includes('/en/') ? pageUrl.substring(pageUrl.indexOf('/en/')) : pageUrl;
77+
78+
comment.push(
79+
`| [${urlForTable}](${reportUrl}) | ${score(averagedResults.performance)} ${averagedResults.performance} | ${score(averagedResults.accessibility)} ${averagedResults.accessibility} | ${score(averagedResults['best-practices'])} ${averagedResults['best-practices']} | ${score(averagedResults.seo)} ${averagedResults.seo} | ${score(averagedResults.pwa)} ${averagedResults.pwa} |`
80+
);
81+
} else {
82+
console.error('No results found for URL:', pageUrl);
83+
}
84+
});
85+
86+
comment.push(
87+
' ',
88+
'*Lighthouse scores are calculated based on the latest audit results*'
89+
);
90+
91+
comment = comment.join('\n');
92+
core.setOutput("comment", comment);
93+
- name: Find current PR # Find the PR associated with this push, if there is one.
94+
uses: jwalton/[email protected]
95+
id: findPr
96+
with:
97+
state: open
98+
- name: Add Lighthouse stats as comment
99+
id: comment_to_pr
100+
uses: marocchino/[email protected]
101+
with:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
number: ${{ steps.findPr.outputs.number }}
104+
header: lighthouse
105+
message: ${{ steps.format_lighthouse_score.outputs.comment }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ robots.txt
5252

5353
# vscode workplace configuration
5454
.vscode
55+
56+
# Crowdin report output
57+
src/data/crowdin/bucketsAwaitingReviewReport.csv

0 commit comments

Comments
 (0)