From 3e0cee11d8ad8e90d751faf8608159ab50602bf4 Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Sun, 22 Aug 2021 20:15:01 -0700 Subject: [PATCH] auto-publish new releases to PIO --- .github/workflows/build_platformIO.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build_platformIO.yml b/.github/workflows/build_platformIO.yml index 25f15c4d..4bef66de 100644 --- a/.github/workflows/build_platformIO.yml +++ b/.github/workflows/build_platformIO.yml @@ -23,22 +23,28 @@ jobs: steps: - uses: actions/checkout@v2 + - name: get latest release version number id: latest_ver run: echo "::set-output name=release::$(awk -F "=" '/version/ {print $2}' library.properties)" + - name: Set up Python uses: actions/setup-python@v2 + - name: Install PlatformIO run: | python -m pip install --upgrade pip pip install --upgrade platformio + - name: package lib run: pio package pack -o PlatformIO-RF24Network-${{ steps.latest_ver.outputs.release }}.tar.gz + - name: Save artifact uses: actions/upload-artifact@v2 with: name: "PIO_pkg_RF24Network" path: PlatformIO*.tar.gz + - name: Upload Release assets if: github.event_name == 'release' uses: csexton/release-asset-action@master @@ -46,6 +52,13 @@ jobs: pattern: "PlatformIO*.tar.gz" github-token: ${{ secrets.GITHUB_TOKEN }} + - name: upload package to PlatformIO Registry + if: github.event_name == 'release' && github.event_type != 'edited' + # PIO lib packages cannot be re-published under the same tag + env: + PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }} + run: pio package publish --owner nrf24 + check_formatting: runs-on: ubuntu-latest