|
| 1 | +name: Generate Index |
| 2 | + |
| 3 | +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + paths: |
| 9 | + - "generator/**" |
| 10 | + - "firmwares/**" |
| 11 | + - "poetry.lock" |
| 12 | + - "pyproject.toml" |
| 13 | + - ".github/workflows/generate-index.yml" |
| 14 | + workflow_dispatch: |
| 15 | + repository_dispatch: |
| 16 | + |
| 17 | +jobs: |
| 18 | + generate-index: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + defaults: |
| 21 | + run: |
| 22 | + working-directory: generator |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout repository |
| 26 | + uses: actions/checkout@v2 |
| 27 | + |
| 28 | + - name: Install Taskfile |
| 29 | + uses: arduino/setup-task@v1 |
| 30 | + |
| 31 | + - name: Install Python |
| 32 | + uses: actions/setup-python@v2 |
| 33 | + with: |
| 34 | + python-version: "3.9" |
| 35 | + |
| 36 | + - name: Install Poetry |
| 37 | + run: pip install poetry |
| 38 | + |
| 39 | + - name: Install Arduino CLI |
| 40 | + uses: arduino/setup-arduino-cli@v1 |
| 41 | + |
| 42 | + - name: Install platforms |
| 43 | + run: | |
| 44 | + arduino-cli core update-index -v |
| 45 | + arduino-cli version |
| 46 | + arduino-cli core install arduino:samd@${{ env.SAMD_V }} -v |
| 47 | + arduino-cli core install arduino:megaavr@${{ env.MEGAAVR_V }} -v |
| 48 | + arduino-cli core install arduino:mbed_nano@${{ env.MBED_NANO_V }} -v |
| 49 | + env: |
| 50 | + SAMD_V: 1.8.11 |
| 51 | + MEGAAVR_V: 1.8.7 |
| 52 | + MBED_NANO_V: 2.2.0 |
| 53 | + |
| 54 | + - name: Install dependencies |
| 55 | + run: | |
| 56 | + cd $GITHUB_WORKSPACE |
| 57 | + task poetry:install-deps |
| 58 | +
|
| 59 | + - name: Generate index |
| 60 | + run: poetry run ./generator.py -a $(which arduino-cli) |
| 61 | + |
| 62 | + # fix `gpg: signing failed: Inappropriate ioctl for device` |
| 63 | + # https://github.com/keybase/keybase-issues/issues/2798 |
| 64 | + - name: Import GPG key |
| 65 | + run: | |
| 66 | + echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 -di > private.key |
| 67 | + gpg --batch --import --passphrase "${{ secrets.PASSPHRASE }}" private.key |
| 68 | + echo "GPG_TTY=$(tty)" >> $GITHUB_ENV |
| 69 | +
|
| 70 | + # disable gpg pass prompt |
| 71 | + # https://stackoverflow.com/questions/49072403/suppress-the-passphrase-prompt-in-gpg-command |
| 72 | + - name: sign the json |
| 73 | + run: gpg --pinentry-mode=loopback --passphrase "${{ secrets.PASSPHRASE }}" --output boards/module_firmware_index.json.sig --detach-sign boards/module_firmware_index.json |
| 74 | + |
| 75 | + - name: create the gzip |
| 76 | + run: gzip --keep boards/module_firmware_index.json |
| 77 | + |
| 78 | + - name: s3 sync |
| 79 | + run: ./s3Copy.sh . s3://arduino-downloads-prod-beagle/arduino-fwuploader |
| 80 | + env: |
| 81 | + AWS_REGION: "us-east-1" # or https://github.com/aws/aws-cli/issues/5623 |
| 82 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 83 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
0 commit comments