-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (47 loc) · 2.12 KB
/
Copy pathfetch-release-stats.yml
File metadata and controls
57 lines (47 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Fetch Release Stats
on:
workflow_dispatch:
jobs:
fetch-stats:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: |
cd release_stats && npm install -D typescript @types/node tsx
- name: Run stats script
run: |
cd release_stats && npx tsx fetch-release-stats.ts
- name: Display Desktop CSV in summary
run: |
echo "# Desktop Release Download Statistics" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Snapshot Date:** $(date +'%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Convert CSV to markdown table
awk -F',' 'NR==1 {
print "| " $1 " | " $2 " | " $3 " | " $4 " | " $5 " | " $6 " | " $7 " | " $8 " | " $9 " | " $10 " | " $11 " |"
print "|---|---|---|---|---|---|---|---|---|---|---|"
} NR>1 {
print "| " $1 " | " $2 " | " $3 " | " $4 " | " $5 " | " $6 " | " $7 " | " $8 " | " $9 " | " $10 " | " $11 " |"
}' release_stats/session-desktop-release-stats.csv >> $GITHUB_STEP_SUMMARY
- name: Display Android CSV in summary
run: |
echo "# Android Release Download Statistics" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Snapshot Date:** $(date +'%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Convert CSV to markdown table
awk -F',' 'NR==1 {
print "| " $1 " | " $2 " | " $3 " | " $4 " | " $5 " | " $6 " | " $7 " | " $8 " | " $9 " | " $10 " | " $11 " |"
print "|---|---|---|---|---|---|---|---|---|---|---|"
} NR>1 {
print "| " $1 " | " $2 " | " $3 " | " $4 " | " $5 " | " $6 " | " $7 " | " $8 " | " $9 " | " $10 " | " $11 " |"
}' release_stats/session-android-release-stats.csv >> $GITHUB_STEP_SUMMARY