Merge pull request #81 from rnd-ash/dev #7
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: PlatformIO Build | |
on: | |
push: | |
branches: [ "main"] | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
UNIFIED_FW: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
- name: Cache pip | |
uses: actions/[email protected] | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache PlatformIO | |
uses: actions/[email protected] | |
with: | |
path: ~/.platformio | |
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
- name: Set up Python | |
uses: actions/[email protected] | |
- name: Install PlatformIO | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade platformio | |
- name: Build Prod PCB FW | |
run: | | |
pio run -e unified | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: UNIFIED_FW | |
path: | | |
.pio/build/unified/firmware.elf | |
.pio/build/unified/firmware.bin | |
Create-Upload: | |
needs: [UNIFIED_FW] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download all artifacts | |
uses: actions/[email protected] | |
- name: View artifacts | |
run: ls -R | |
- name: set date env | |
run: echo "NOW=$(date +'%Y.%m.%d')" >> $GITHUB_ENV | |
- name: create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.BRANCH_NAME }}-${{ env.NOW }} | |
release_name: Release Main | |
draft: false | |
prerelease: false | |
- name: Upload firmware | |
id: upload-release-asset | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.BRANCH_NAME }}-${{ github.sha }} | |
name: Release ${{ env.BRANCH_NAME }} | |
files: | | |
UNIFIED_FW/firmware.elf | |
UNIFIED_FW/firmware.bin |