From 72f4ba765513528c375db176df9ad4cffbccecee Mon Sep 17 00:00:00 2001 From: trinami Date: Fri, 29 Mar 2024 08:23:00 +0100 Subject: [PATCH] fix: ci/cd --- .github/workflows/ci.yaml | 1 - .github/workflows/create-release.yaml | 69 ++++++++++++++++----------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec0df51..709d975 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,7 +2,6 @@ name: PlatformIO CI on: - push - - pull_request jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 83607ce..90baecb 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -1,24 +1,51 @@ on: - push: - tags: - - '*' + release: + types: [published] jobs: - create_release: + build: runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - - name: Create release - uses: actions/create-release@v1 - id: create_release + - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: - draft: false - prerelease: false - release_name: ${{ github.ref_name }} - tag_name: ${{ github.ref_name }} + path: | + ~/.cache/pip + ~/.platformio/.cache + key: ${{ runner.os }}-pio + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install PlatformIO Core + run: pip install --upgrade platformio + + - name: Build PlatformIO Project + run: pio run + + # - name: Archive production artifacts + # uses: actions/upload-artifact@v2 + # with: + # name: firmware + # path: .pio/build/**/mobiflight*.hex + + - name: Release + uses: softprops/action-gh-release@v1 env: - GITHUB_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: .pio/build/d1_mini/firmware.bin + name: "marquettino-d1_mini-${{ github.ref_name }}.bin" + - name: Release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: .pio/build/nodemcuv2/firmware.bin + name: "marquettino-nodemcuv2-${{ github.ref_name }}.bin" + + + + build_release_binaries: needs: create_release runs-on: ubuntu-latest @@ -29,11 +56,6 @@ jobs: steps: - uses: actions/checkout@v2 name: Checkout code - - uses: canastro/copy-file-action@0.0.2 - name: copy local_config.h - with: - source: "local_config.dist.h" - target: "local_config.h" - uses: arduino/compile-sketches@v1.0.1 name: Compile Sketch with: @@ -44,14 +66,7 @@ jobs: fqbn: "esp8266:esp8266:${{ matrix.board }} https://arduino.esp8266.com/stable/package_esp8266com_index.json" sketch-paths: | - ./ - libraries: | - # no libraries required - - name: LEDMatrixDriver - version: 0.2.2 - - name: PubSubClient - version: 2.8.0 - - name: WiFiManager - version: 2.0.12-beta + - name: Upload binary uses: actions/upload-release-asset@v1 env: