forked from zephyrproject-rtos/ArduinoCore-zephyr
-
Notifications
You must be signed in to change notification settings - Fork 55
72 lines (63 loc) · 2.49 KB
/
upload_json.yml
File metadata and controls
72 lines (63 loc) · 2.49 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (c) Arduino s.r.l. and/or its affiliated companies
# SPDX-License-Identifier: Apache-2.0
# CI workflow to upload the zephyr_ci package index to GitHub Pages.
name: Deploy CI JSON to GitHub Pages
on:
workflow_run:
workflows: ["Package, test and upload core"]
types:
- completed
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# 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: "pages"
cancel-in-progress: false
jobs:
submit-json-to-gh-pages:
name: Update git JSON on Github Pages
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'push'
&& !contains(github.event.workflow_run.head_branch, '/')
&& github.event.workflow_run.conclusion == 'success' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}/package_zephyr_ci_index.json
steps:
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v20
with:
workflow: package-core.yml
run_id: ${{ github.event.workflow_run.id }}
name: ArduinoCore-zephyr-.*-jsons
name_is_regexp: true
- name: Setup private SSH key
uses: webfactory/ssh-agent@v0.10.0
with:
ssh-private-key: ${{ secrets.PACKAGE_INDEX_DEPLOY_KEY }}
- name: Create zephyr_ci package index
run: |
git clone ${{ secrets.PACKAGE_INDEX_REPO }} package_index
mkdir -p package_index/zephyr_ci/arduino/platforms pages
cd package_index
cp ../ArduinoCore-*/*.json zephyr_ci/arduino/platforms/
(cd zephyr_staging && for dir in */tools ; do mkdir -p ../zephyr_ci/$dir && cp $dir/*.json ../zephyr_ci/$dir/ ; done)
python3 -m venv venv
. venv/bin/activate
pip install -r scripts/requirements.txt
scripts/meld.py prod.json prod/
scripts/meld.py --ref-index prod.json ../pages/package_zephyr_ci_index.json zephyr_ci/
- name: Setup Pages
uses: actions/configure-pages@v6
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: 'pages/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5