Skip to content

Commit

Permalink
ci: add upload workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mdvorak committed Mar 31, 2024
1 parent 5874bcd commit ab7da81
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
43 changes: 35 additions & 8 deletions .github/workflows/test.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test
name: Build

on:
push:
Expand All @@ -20,19 +20,16 @@ jobs:
fail-fast: false
matrix:
# ESP-IDF versions and targets
idf_ver: [ v4.4, v5.0, v5.1, v5.2 ]
idf_ver: [ v4.4, v5.1, v5.2 ]
idf_target: [ esp32, esp32s2, esp32s3, esp32c3, esp32h2 ]
# Filter out unsupported combinations
exclude:
- { idf_target: esp32h2, idf_ver: v4.4 }
container: espressif/idf:release-${{ matrix.idf_ver }}
steps:
- uses: actions/checkout@v4

- name: Setup Component Manager
run: |
. ${IDF_PATH}/export.sh
pip install --upgrade idf-component-manager
with:
submodules: "recursive"

- name: Build
env:
Expand All @@ -46,11 +43,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11

- name: Install platformio
run: |
Expand All @@ -63,3 +62,31 @@ jobs:
- name: Build
run: platformio run -d example

build-all:
runs-on: ubuntu-latest
needs:
- build
- platformio
# Only aggregating job
steps:
- run: echo OK

upload:
runs-on: ubuntu-latest
environment: release
if: github.ref_type == 'tag'
needs:
- build-all
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Upload component to component registry
uses: espressif/upload-components-ci-action@v1
with:
name: ${{ github.event.repository.name }}
version: ${{ github.ref_name }}
namespace: ${{ github.repository_owner }}
api_token: ${{ secrets.ESP_IDF_COMPONENT_API_TOKEN }}
1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dependencies.lock
4 changes: 3 additions & 1 deletion idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: "double_reset"
description: Detect double reset, which can be used to place program in special reconfiguration mode, like entering Wi-Fi credentials.
url: https://github.com/mdvorak/esp-double-reset.git
url: https://github.com/mdvorak/esp-double-reset
repository: https://github.com/mdvorak/esp-double-reset
license: Unlicense
dependencies:
idf:
version: ">=4.1"

0 comments on commit ab7da81

Please sign in to comment.