From 7916d79ff10d8883492f9d887e962fbd9845d35e Mon Sep 17 00:00:00 2001 From: BG8LGP <130383549+BG8LGP@users.noreply.github.com> Date: Tue, 7 Nov 2023 20:23:28 +0800 Subject: [PATCH] Add github actions #86 --- .github/workflows/main.yml | 33 ++++++++++++++++++++++++++++ .github/workflows/release.yaml | 40 ++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..40977d0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +on: + push: + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: arm-none-eabi-gcc + uses: carlosperate/arm-none-eabi-gcc-action@v1 + with: + release: '10.3-2021.10' + + - name: Install Python dependencies + run: python -m pip install --upgrade pip crcmod + + - name: Checkout + uses: actions/checkout@v3 + + - name: Submodules + run: git submodule update --init --recursive --depth 1 + + - name: Make + run: make + + - name: size + run: arm-none-eabi-size firmware + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v3 + with: + name: firmware + path: firmware*.bin diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..bb743ed --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,40 @@ +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: arm-none-eabi-gcc + uses: carlosperate/arm-none-eabi-gcc-action@v1 + with: + release: '10.3-2021.10' + + - name: Install Python dependencies + run: python3 -m pip install --upgrade pip crcmod + + - name: Checkout + uses: actions/checkout@v3 + + - name: Submodules + run: git submodule update --init --recursive --depth 1 + + - name: Make + run: make + + - name: size + run: arm-none-eabi-size firmware + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v3 + with: + name: firmware + path: firmware*.bin + + - name: 'Create Release' + uses: ncipollo/release-action@v1 + with: + artifacts: "firmware*.bin"