ci: Fix PlatformIO publish (#7) #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
name: release-please | |
jobs: | |
release-please: | |
runs-on: ubuntu-22.04 | |
steps: | |
# Add packages to update into release-please-config.json | |
- name: Write new version to packages | |
id: release | |
uses: google-github-actions/release-please-action@v4 | |
with: | |
token: ${{ secrets.MAINTAINER_PAT }} | |
target-branch: ${{ github.ref_name }} | |
# Steps bellow occurs only when a version is created | |
- uses: actions/checkout@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Cache pio and pip | |
if: ${{ steps.release.outputs.release_created }} | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pip | |
~/.platformio/.cache | |
key: ${{ runner.os }}-pio | |
- uses: actions/setup-python@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
with: | |
python-version: '3.9' | |
- name: Install PlatformIO Core | |
if: ${{ steps.release.outputs.release_created }} | |
run: pip install --upgrade platformio | |
- name: PlatformIO publish | |
if: ${{ steps.release.outputs.release_created }} | |
env: | |
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PIO_PAT }} | |
run: pio package publish --type library --no-interactive |