-
-
Notifications
You must be signed in to change notification settings - Fork 16
60 lines (56 loc) · 2.64 KB
/
build-test.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
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 }}/${{ env.APP_NAME }}_bootloader.bin EXECUTABLES=../../${{ env.OUT_DIR }}/${{ env.APP_NAME }}_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@v3
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@v3
- name: Move files to the root
run: find -mindepth 2 -exec mv {} . \;
- name: Generate index.html
run: "(echo \"<html><head><title>FDSKey</title></head><meta http-equiv='Cache-Control' content='no-cache, no-store, must-revalidate'/><body>Updated: `date`<br/><br/>Main firmware (.bin): <a href='fdskey.bin'>fdskey.bin</a><br/><small>(MD5: `md5sum fdskey.bin | awk '{print $1}'`)</small></br>Put <b>fdskey.bin</b> file on a microSD card and hold all four buttons during power-on to update the firmware.<br/><br/>Main firmware (.elf): <a href='fdskey.elf'>fdskey.elf</a><br/><small>(MD5: `md5sum fdskey.elf | awk '{print $1}'`)</small></br>Use this file to write firmware using programmer.</br></br>Bootloader (.bin): <a href='fdskey_bootloader.bin'>fdskey_bootloader.bin</a><br/><small>(MD5: `md5sum fdskey_bootloader.bin | awk '{print $1}'`)</small></br>It's just bootloader as raw binary file.</br></br>Bootloader (.elf): <a href='fdskey_bootloader.elf'>fdskey_bootloader.elf</a><br/><small>(MD5: `md5sum fdskey_bootloader.elf | awk '{print $1}'`)</small></br>Use this file to write bootloader using programmer.</body></html>\") > index.html"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1