name: Build, test, upload on: push: branches: [ master ] pull_request: branches: [ master ] workflow_dispatch: permissions: contents: read pages: write id-token: write jobs: build: runs-on: [ubuntu-latest] env: APP_NAME: fdskey OUT_DIR: fdskey steps: - name: Checkout uses: actions/checkout@v3 - name: Install compiler run: sudo apt-get install gcc-arm-none-eabi - name: Build bootloader run: | mkdir -p ${{ env.OUT_DIR }} make -C FdsKey_bootloader/interim/ OBJCOPY_BIN=../../${{ env.OUT_DIR }}/bootloader.bin EXECUTABLES=../../${{ env.OUT_DIR }}/bootloader.elf - name: Build firmware run: | mkdir -p ${{ env.OUT_DIR }} make -C FdsKey/interim/ OBJCOPY_BIN=../../${{ env.OUT_DIR }}/${{ env.APP_NAME }}.bin EXECUTABLES=../../${{ env.OUT_DIR }}/${{ env.APP_NAME }}.elf - name: Archive working-directory: ${{ env.OUT_DIR }} run: | tar -czvf ../${{ env.APP_NAME }}.tar.gz * - name: Upload artifact uses: actions/upload-artifact@v4 with: name: ${{ env.APP_NAME }} path: ${{ env.OUT_DIR }} upload-to-pages: needs: build runs-on: ubuntu-latest steps: - name: Download artifacts uses: actions/download-artifact@v4.1.7 - name: Move files to the root run: find -mindepth 2 -exec mv {} . \; - name: Calculate and save MD5 for each file run: | for file in *; do if [ -f "$file" ]; then md5sum "$file" | awk '{print $1}' > "${file}.md5" fi done - name: Generate index.html run: | echo "FDSKey" > index.html echo "Updated: `date`

" >> index.html echo "Main firmware (.bin): fdskey.bin
(MD5: `cat fdskey.bin.md5`)
Put the fdskey.bin file on a microSD card and hold all four buttons during power-on to update the firmware. Or use a programmer and write it to the 0x08020000 address.

" >> index.html echo "Main firmware (.elf): fdskey.elf
(MD5: `cat fdskey.elf.md5`)
Use this file to write firmware using programmer.

" >> index.html echo "Bootloader (.bin): bootloader.bin
(MD5: `cat bootloader.bin.md5`)
You can use it to update the bootloader via the service menu. Or use a programmer and write it to the 0x08000000 address.

" >> index.html echo "Bootloader (.elf): bootloader.elf
(MD5: `cat bootloader.elf.md5`)
Use this file to write the bootloader using programmer.

" >> index.html echo "" >> index.html - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: '.' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4