build #5
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
name: build | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache pip | |
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') }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
pip install wheel | |
pip install -U platformio | |
- name: Get the current branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v6 | |
- name: Get the current commit ID | |
id: commit | |
uses: pr-mpt/actions-commit-hash@v2 | |
- name: Set rel env | |
run: echo "PLATFORMIO_BUILD_FLAGS=-DVERSION='\"${{ steps.commit.outputs.short }}/${{ steps.branch-name.outputs.current_branch }}\"'" >> $GITHUB_ENV | |
- name: Run PlatformIO | |
run: pio run -e ttgo-t-sim7600e-l1c -e ttgo-t-sim7600e-l1c-verbose | |
- name: Rename firmware | |
run: | | |
cp .pio/build/ttgo-t-sim7600e-l1c/firmware.bin ttgo-t-sim7600e-l1c.bin | |
cp .pio/build/ttgo-t-sim7600e-l1c-verbose/firmware.bin ttgo-t-sim7600e-l1c-verbose.bin | |
- name: Release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: "${{ steps.commit.outputs.short }}/${{ steps.branch-name.outputs.current_branch }}" | |
tag: ${{ steps.commit.outputs.short }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
makeLatest: true | |
generateReleaseNotes: true | |
draft: true | |
artifacts: | | |
*.bin |