Skip to content

Commit

Permalink
Update build-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotmatson authored Mar 28, 2023
1 parent 5ab3f64 commit a1260f2
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,44 @@ on:
pull_request:

jobs:
build:
build-esp32s3:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Cache pip
- name: Checkout
uses: actions/checkout@v3
- name: Cache pip and platformio
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
pio pkg update
# pio run -t clean
run: pip install --upgrade platformio
- name: Set version var
run: echo "PLATFORMIO_BUILD_FLAGS=-DFW_VERSION='\"${{ inputs.release-version }}\"' -DREPO_PATH='\"$GITHUB_REPOSITORY\"'" >> $GITHUB_ENV
if: github.event_name == 'workflow_dispatch'
- name: Setup git for private libraries
run: gh auth setup-git
- name: Run PlatformIO
run: pio run -e esp-wrover-kit
run: pio run -e esp32-s3-devkitc-1
- name: Rename firmware
run: cp .pio/build/esp-wrover-kit/firmware.bin esp32.bin
run: cp .pio/build/esp32-s3-devkitc-1/firmware.bin esp32s3.bin
- name: Cache Build
if: github.event_name == 'workflow_dispatch'
uses: actions/cache@v3
with:
path: 'esp32.bin'
path: 'esp32s3.bin'
key: ${{ runner.os }}-${{ github.run_id }}

archive:
needs: build
archive-esp32s3:
needs: build-esp32s3
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -74,16 +68,17 @@ jobs:
if: github.event_name == 'workflow_dispatch'
uses: actions/cache@v3
with:
path: 'esp32.bin'
path: 'esp32s3.bin'
key: ${{ runner.os }}-${{ github.run_id }}
- name: Archive Build
uses: actions/upload-artifact@v3
with:
name: 'build'
path: 'esp32.bin'
path: 'esp32s3.bin'

release:
needs: build
needs:
- build-esp32s3
if: (github.event_name == 'workflow_dispatch' && inputs.release-type != 'build only')
runs-on: ubuntu-latest
permissions:
Expand All @@ -93,7 +88,7 @@ jobs:
if: github.event_name == 'workflow_dispatch'
uses: actions/cache@v3
with:
path: 'esp32.bin'
path: 'esp32s3.bin'
key: ${{ runner.os }}-${{ github.run_id }}
- name: Development Release
uses: ncipollo/release-action@v1
Expand Down

0 comments on commit a1260f2

Please sign in to comment.