diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index abbf440..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Lint check - -on: [push, pull_request] - -jobs: - lint-clang-format: - name: Lint with clang-format - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Check code with clang-format - uses: jidicula/clang-format-action@v4.5.0 - with: - clang-format-version: "14" - lint-black: - name: Lint with black - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - name: Install test dependencies - uses: BSFishy/pip-action@v1 - with: - packages: | - black - isort - - name: Check code with black - run: black --check . - - name: Check code with isort - run: isort --profile black . --check-only diff --git a/.github/workflows/platformio-publish.yml b/.github/workflows/platformio-publish.yml deleted file mode 100644 index 12e2d52..0000000 --- a/.github/workflows/platformio-publish.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: PlatformIO Publish - -on: - push: - tags: - - v*.*.* - -jobs: - publish: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Cache pip - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Cache PlatformIO - uses: actions/cache@v2 - with: - path: ~/.platformio - key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - - name: Set up Python - uses: actions/setup-python@v2 - - name: Install PlatformIO - run: | - python -m pip install --upgrade pip - pip install --upgrade platformio - - name: Publish PlatformIO package - run: pio package publish --non-interactive - env: - CI: true - PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }} - - name: Get latest version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Release on GitHub - uses: softprops/action-gh-release@v1 - with: - name: ${{ steps.get_version.outputs.VERSION }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/push-dev.yml b/.github/workflows/push-dev.yml new file mode 100644 index 0000000..7fe9e20 --- /dev/null +++ b/.github/workflows/push-dev.yml @@ -0,0 +1,12 @@ +name: Push (dev), Pull Request +on: + push: + branches: ["**"] + pull_request: +jobs: + lint-clang: + name: Run Clang lint + uses: kuba2k2/kuba2k2/.github/workflows/lint-clang.yml@master + lint-python: + name: Run Python lint + uses: kuba2k2/kuba2k2/.github/workflows/lint-python.yml@master diff --git a/.github/workflows/docs.yml b/.github/workflows/push-master.yml similarity index 94% rename from .github/workflows/docs.yml rename to .github/workflows/push-master.yml index 3fc7e73..a887ba4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/push-master.yml @@ -1,10 +1,8 @@ -name: Deploy docs on GitHub Pages - +name: Push (master) on: push: - branches: - - master - + branches: ["master"] + workflow_dispatch: jobs: docs: name: Deploy docs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..237ce33 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release +on: + push: + tags: ["v*.*.*"] +jobs: + lint-clang: + name: Run Clang lint + uses: kuba2k2/kuba2k2/.github/workflows/lint-clang.yml@master + publish-pio-platform: + name: Publish PlatformIO platform + needs: + - lint-clang + uses: kuba2k2/kuba2k2/.github/workflows/publish-pio-platform.yml@master + secrets: + PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }} + gh-release: + name: Publish GitHub release + needs: + - publish-pio-platform + uses: kuba2k2/kuba2k2/.github/workflows/gh-release.yml@master + permissions: + contents: write