-
Notifications
You must be signed in to change notification settings - Fork 15
122 lines (115 loc) · 5.5 KB
/
table.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Simple workflow for deploying static content to GitHub Pages
name: Generate and Upload Tables
on:
# Runs on pushes targeting the default branch
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
deploy:
description: 'Upload Tables to Pages'
type: boolean
debuginfo:
description: 'Output Debug'
type: boolean
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "tables"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
build:
name: Build Tables
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Generate Images
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
sudo pip3 install --upgrade meson
pip install -r assets/requirements.txt
mkdir assets/output
python assets/generate_svgimage.py -p . -o assets/output --html https://${{ github.repository_owner }}.github.io/support-matrix | tee build.log
python assets/generate_svgimage.py -p . -o assets/output --html https://${{ github.repository_owner }}.github.io/support-matrix -l zh | tee -a build.log
- name: Check Commit ID
id: truecommit
run: |
echo "shortid=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
echo "longid=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
echo "$(git log -1)" >> ${{ github.workspace }}/message.log
- name: Generate Hash
id: hash
working-directory: ${{ github.workspace }}/assets/output/
run: echo "$(sha256sum *)" >> ${{ github.workspace }}/assets/output/result.sha256
- name: Upload to Pages
uses: actions/upload-pages-artifact@v3
with:
name: support-matrix-${{ github.run_id }}
path: 'assets/output'
- name: Output Success Summary
run: |
echo "# Support Matrix Table Build Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "[CI #${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) powered by [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) has successfully generate tables." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Commit Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "CI has built on commit [${{ steps.truecommit.outputs.shortid }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ steps.truecommit.outputs.longid }}). The commit message is shown below." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
cat ${{ github.workspace }}/message.log >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Artifacts Hash" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
cat ${{ github.workspace }}/assets/output/result.sha256 >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Build Log" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
cat ${{ github.workspace }}/build.log >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
- name: Output Debug Info
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debuginfo }}
run: |
echo "## Debug" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo "${{ toJSON( github ) }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
deploy:
needs: build
name: Upload Tables
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || ( github.event_name == 'workflow_dispatch' && inputs.deploy ) }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: support-matrix-${{ github.run_id }}
- name: Output Success Summary
run: |
echo "# Support Matrix Table Deployment Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "[CI #${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) powered by [${{ github.repository }}](${{ github.server_url }}/${{ github.repository }}) has successfully deployed tables to pages." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Visit \`${{ steps.deployment.outputs.page_url }}{name}\` for tables." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY