From df2452a89734123206eb9c778a119190f2d54281 Mon Sep 17 00:00:00 2001 From: Chris Andreae Date: Sun, 18 Sep 2022 17:07:01 +0900 Subject: [PATCH] Github build action: build Glove80 combined firmware using Nix --- .github/workflows/build.yml | 13 +++---- .github/workflows/nix-build.yml | 62 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/nix-build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2d1992dc43b..17be98de7488 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ on: jobs: build: - if: ${{ always() }} + if: ${{ false }} runs-on: ubuntu-latest container: image: docker.io/zmkfirmware/zmk-build-arm:3.5 @@ -131,7 +131,7 @@ jobs: throw new Error('Failed to build one or more configurations'); } compile-matrix: - if: ${{ always() }} + if: ${{ false && always() }} runs-on: ubuntu-latest needs: [core-coverage, board-changes, nightly] outputs: @@ -171,7 +171,7 @@ jobs: shieldArgs: JSON.stringify(shieldArgs), })); core-coverage: - if: ${{ needs.get-changed-files.outputs.core-changes == 'true' }} + if: ${{ false && needs.get-changed-files.outputs.core-changes == 'true' }} runs-on: ubuntu-latest needs: get-changed-files outputs: @@ -200,7 +200,7 @@ jobs: return [...include, ...coreCoverage.include]; board-changes: - if: ${{ needs.get-changed-files.outputs.board-changes == 'true' }} + if: ${{ false && needs.get-changed-files.outputs.board-changes == 'true' }} runs-on: ubuntu-latest needs: [get-grouped-hardware, get-changed-files] outputs: @@ -284,7 +284,7 @@ jobs: }); }))).flat(); nightly: - if: ${{ github.event_name == 'schedule' }} + if: ${{ false && github.event_name == 'schedule' }} runs-on: ubuntu-latest needs: get-grouped-hardware outputs: @@ -329,6 +329,7 @@ jobs: return [...includeOnboard, ...includeInterconnect]; get-grouped-hardware: + if: ${{ false }} runs-on: ubuntu-latest outputs: organized-metadata: ${{ steps.organize-metadata.outputs.result }} @@ -406,7 +407,7 @@ jobs: return JSON.stringify(grouped).replace(/\\/g,"\\\\").replace(/`/g,"\\`"); result-encoding: string get-changed-files: - if: ${{ github.event_name != 'schedule' }} + if: ${{ false && github.event_name != 'schedule' }} runs-on: ubuntu-latest outputs: changed-files: ${{ steps.changed-files.outputs.all_changed_files }} diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml new file mode 100644 index 000000000000..6f6b0bbf8663 --- /dev/null +++ b/.github/workflows/nix-build.yml @@ -0,0 +1,62 @@ +name: Build + +on: + push: + paths: + - ".github/workflows/nix-build.yml" + - "default.nix" + - "app/**" + - "nix/**" + branches: + - "**" + tags: + - "**" + pull_request: + paths: + - ".github/workflows/nix-build.yml" + - "default.nix" + - "app/**" + - "nix/**" + +jobs: + build: + name: Build Glove80 Firmware + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v27 + with: + nix_path: nixpkgs=channel:nixos-22.05 + - uses: cachix/cachix-action@v15 + with: + name: moergo-glove80-zmk-dev + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + skipPush: "${{ github.repository != 'moergo-sc/zmk' }}" + - name: Build Glove80 combined firmware + run: nix-build -A glove80_combined -o combined + - name: Copy result out of nix store + run: cp combined/glove80.uf2 glove80.uf2 + - name: Upload result + uses: actions/upload-artifact@v4 + with: + name: glove80.uf2 + path: glove80.uf2 + release: + name: Create Release for Tag + if: >- + github.repository == 'moergo-sc/zmk' + && github.event_name == 'push' + && contains(github.ref, 'refs/tags/v') + needs: build + runs-on: ubuntu-latest + steps: + - name: Download compiled firmware artifact + uses: actions/download-artifact@v4 + with: + name: glove80.uf2 + - name: Create Release for Tag + uses: ncipollo/release-action@v1 + with: + artifacts: "glove80.uf2" + artifactErrorsFailBuild: true + generateReleaseNotes: true