@@ -2,15 +2,14 @@ name: Generate Index
22
33# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
44on :
5- pull_request :
6- branches :
7- - umbynos/index_generation
85 push :
6+ branches :
97 paths :
108 - " generator/**"
119 - " firmwares/**"
1210 - " poetry.lock"
1311 - " pyproject.toml"
12+ - " .github/workflows/generate-index.yml"
1413 workflow_dispatch :
1514 repository_dispatch :
1615
3130 - name : Install Python
3231 uses : actions/setup-python@v2
3332 with :
34- python-version : " 3.8 "
33+ python-version : " 3.9 "
3534
3635 - name : Install Poetry
3736 run : pip install poetry
@@ -45,28 +44,39 @@ jobs:
4544 arduino-cli version
4645 arduino-cli core install arduino:samd@${{ env.SAMD_V }} -v
4746 arduino-cli core install arduino:megaavr@${{ env.MEGAAVR_V }} -v
48- arduino-cli core install arduino:mebd_nano @${{ env.MBED_NANO_V }} -v
47+ arduino-cli core install arduino:mbed_nano @${{ env.MBED_NANO_V }} -v
4948 env :
50- SAMD_V : 1.18 .11
49+ SAMD_V : 1.8 .11
5150 MEGAAVR_V : 1.8.7
5251 MBED_NANO_V : 2.2.0
5352
5453 - name : Install dependencies
55- run : task poetry:install-deps
54+ run : |
55+ cd $GITHUB_WORKSPACE
56+ task poetry:install-deps
5657
5758 - name : Generate index
58- run : ./generator.py -a $(which arduino-cli)
59-
59+ run : poetry run ./generator.py -a $(which arduino-cli)
60+
61+ # fix `gpg: signing failed: Inappropriate ioctl for device`
62+ # https://github.com/keybase/keybase-issues/issues/2798
6063 - name : Import GPG key
6164 run : |
62- echo "${{ secrets.GPG_PRIVATE_KEY }}" > private.key
63- gpg --import --batch --passphrase ${{ secrets.PASSPHRASE }} private.key
64-
65+ echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 -di > private.key
66+ gpg --batch --import --passphrase "${{ secrets.PASSPHRASE }}" private.key
67+ echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
68+
69+ # disable gpg pass prompt
70+ # https://stackoverflow.com/questions/49072403/suppress-the-passphrase-prompt-in-gpg-command
6571 - name : sign the json
66- run : gpg --output boards/module_firmware_index.json.sig --detach-sign boards/module_firmware_index.json
72+ run : gpg --pinentry-mode=loopback --passphrase "${{ secrets.PASSPHRASE }}" -- output boards/module_firmware_index.json.sig --detach-sign boards/module_firmware_index.json
6773
6874 - name : create the gzip
6975 run : gzip --keep boards/module_firmware_index.json
7076
7177 - name : s3 sync
7278 run : ./s3Copy.sh . s3://arduino-downloads-prod-beagle/arduino-fwuploader
79+ env :
80+ AWS_REGION : " us-east-1" # or https://github.com/aws/aws-cli/issues/5623
81+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
82+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
0 commit comments