-
-
Notifications
You must be signed in to change notification settings - Fork 17
97 lines (81 loc) · 3.06 KB
/
generate-index.yml
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
name: Generate Index
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
branches:
- main
paths:
- "generator/**"
- "firmwares/**"
- "poetry.lock"
- "pyproject.toml"
- ".github/workflows/generate-index.yml"
workflow_dispatch:
repository_dispatch:
jobs:
generate-index:
runs-on: ubuntu-latest
defaults:
run:
working-directory: generator
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Taskfile
uses: arduino/setup-task@v1
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install Poetry
run: pip install poetry
- name: Install Arduino CLI
uses: arduino/setup-arduino-cli@v1
- name: Install platforms
run: |
arduino-cli core update-index -v
arduino-cli version
arduino-cli core install arduino:samd@${{ env.SAMD_V }} -v
env:
SAMD_V: 1.8.11
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
task poetry:install-deps
- name: Generate plugin firmware index
run: poetry run ./generator.py -a $(which arduino-cli)
- name: Generate module firmware index
run: poetry run ./generator.py -a $(which arduino-cli) --no-new
# fix `gpg: signing failed: Inappropriate ioctl for device`
# https://github.com/keybase/keybase-issues/issues/2798
- name: Import GPG key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 -di > /tmp/private.key
gpg --batch --import --passphrase "${{ secrets.PASSPHRASE }}" /tmp/private.key
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
# disable gpg pass prompt
# https://stackoverflow.com/questions/49072403/suppress-the-passphrase-prompt-in-gpg-command
- name: sign the module firmware index json
run: |
gpg \
--pinentry-mode=loopback \
--passphrase "${{ secrets.PASSPHRASE }}" \
--output boards/module_firmware_index.json.sig \
--detach-sign boards/module_firmware_index.json
- name: sign the plugin firmware index json
run: |
gpg \
--pinentry-mode=loopback \
--passphrase "${{ secrets.PASSPHRASE }}" \
--output boards/plugin_firmware_index.json.sig \
--detach-sign boards/plugin_firmware_index.json
- name: create the gzip
run: gzip --keep boards/module_firmware_index.json boards/plugin_firmware_index.json
- name: s3 sync
run: |
aws s3 sync boards/ s3://${{ secrets.DOWNLOADS_BUCKET }}/arduino-fwuploader/boards
aws s3 sync firmwares/ s3://${{ secrets.DOWNLOADS_BUCKET }}/arduino-fwuploader/firmwares
env:
AWS_REGION: "us-east-1" # or https://github.com/aws/aws-cli/issues/5623
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}