diff --git a/.github/workflows/platformio_workflow.yml b/.github/workflows/platformio.yml similarity index 72% rename from .github/workflows/platformio_workflow.yml rename to .github/workflows/platformio.yml index 2559031..492a98c 100644 --- a/.github/workflows/platformio_workflow.yml +++ b/.github/workflows/platformio.yml @@ -12,12 +12,12 @@ on: jobs: PlatformIO-Check: - uses: ./.github/workflows/platformio_check_template.yml + uses: sensirion/.github/.github/workflows/platformio_check.yml@main with: pio-environment-list: '["ble_example", "basicUsage"]' PlatformIO-Build: - uses: ./.github/workflows/platformio_build_template.yml + uses: sensirion/.github/.github/workflows/platformio_build.yml@main needs: PlatformIO-Check with: pio-environment-list: '["ble_example", "basicUsage"]' @@ -25,12 +25,12 @@ jobs: PlatformIO-Package: if: ${{ (github.ref_type != 'tag') && (github.ref_name == 'master') }} needs: PlatformIO-Build - uses: ./.github/workflows/platformio_publish_template.yml + uses: sensirion/.github/.github/workflows/platformio_publish.yml@main with: should-publish: false PlatformIO-Publish: - uses: ./.github/workflows/platformio_publish_template.yml + uses: sensirion/.github/.github/workflows/platformio_publish.yml@main if: github.ref_type == 'tag' needs: PlatformIO-Build with: diff --git a/.github/workflows/platformio_build_template.yml b/.github/workflows/platformio_build_template.yml deleted file mode 100644 index c7b75dc..0000000 --- a/.github/workflows/platformio_build_template.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: PlatformIO Build - -on: - workflow_call: - inputs: - pio-environment-list: - type: string - default: '["usage_example"]' - pio-ini-location: - type: string - default: "." - -jobs: - platformio-build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - environment: ${{ fromJSON(inputs.pio-environment-list) }} - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - name: Install PlatformIO Core - run: pip install --upgrade platformio - - name: Build examples with 'pio run' - working-directory: ${{ inputs.pio-ini-location }} - run: pio run -e ${{ matrix.environment }} diff --git a/.github/workflows/platformio_check_template.yml b/.github/workflows/platformio_check_template.yml deleted file mode 100644 index be39b44..0000000 --- a/.github/workflows/platformio_check_template.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: PlatformIO Check - -on: - workflow_call: - inputs: - pio-environment-list: - type: string - default: '["usage_example"]' - pio-ini-location: - type: string - default: "." - -jobs: - platformio-check: - runs-on: ubuntu-latest - strategy: - matrix: - environment: ${{ fromJSON(inputs.pio-environment-list) }} - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - name: Install PlatformIO Core - run: pip install --upgrade platformio - - name: Run 'pio check' - working-directory: ${{ inputs.pio-ini-location }} - run: pio check -e ${{ matrix.environment }} diff --git a/.github/workflows/platformio_publish_template.yml b/.github/workflows/platformio_publish_template.yml deleted file mode 100644 index fdea098..0000000 --- a/.github/workflows/platformio_publish_template.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: PlatformIO Publish - -on: - workflow_call: - inputs: - pkg-owner: - type: string - description: The user/org that will be the owner of the published package - default: "sensirion" - should-publish: - type: boolean - description: Should the package be published to the registry - default: false - secrets: - pio-registry-token: - description: PlatformIO Token used to login - required: false - -jobs: - platformio-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - name: Install PlatformIO Core - run: pip install --upgrade platformio - - name: Recreate tmp folder - run: | - if [ -d ./tmp/ ]; then rm -Rf ./tmp/; fi - mkdir ./tmp/ - - name: Select relevant resource to package - run: | - cp -r examples tmp - cp -r src tmp - cp -r py_scripts tmp - cp CHANGELOG.md tmp - cp library.properties tmp - cp LICENSE tmp - cp platformio.ini tmp - cp README.md tmp - - name: Create library package - run: pio pkg pack tmp - - name: Upload package archive - uses: actions/upload-artifact@v4 - with: - name: pio-library-archive - path: ./*.tar.gz - retention-days: 2 - - name: Login into PlatformIO - if: ${{ inputs.should-publish }} - run: pio account login - env: - PLATFORMIO_AUTH_TOKEN: ${{ secrets.pio-registry-token }} - - name: Run 'pio pkg publish' - if: ${{ inputs.should-publish }} - run: pio pkg publish --owner ${{ inputs.pkg-owner }} --no-interactive ./*.tar.gz