v1.0.3rc4 #24
Workflow file for this run
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 Photon | |
on: | |
workflow_dispatch: | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
name: Build and Upload | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check out the PR | |
uses: actions/checkout@v2 | |
- name: Select Python 3.7 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.7' | |
architecture: 'x64' | |
- name: Generate Short SHA Environment Variable | |
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Install PlatformIO | |
run: | | |
pip install -U platformio | |
pio upgrade --dev | |
pio pkg update --global | |
- name: Compile Artifacts for Release | |
if: github.event_name == 'release' | |
run: | | |
cd photon | |
TAG=${{ github.event.release.tag_name }} | |
EDITED_TAG=${TAG//./_} | |
echo "Tag is: $EDITED_TAG" | |
if [[ $EDITED_TAG != *"rc"* ]]; then sed -i "s/#define VERSION beta/#define VERSION $EDITED_TAG/g" src/main.cpp; fi | |
pio run | |
cp .pio/build/lumenpnp-feeder/firmware.bin ../photon-lumenpnp-${{ github.event.release.tag_name }}.bin | |
cp .pio/build/lumenpnp-feeder/firmware.elf ../photon-lumenpnp-${{ github.event.release.tag_name }}.elf | |
- name: Upload Artifacts to Release | |
uses: softprops/action-gh-release@v1 | |
if: github.event_name == 'release' | |
with: | |
files: | | |
photon-lumenpnp-${{ github.event.release.tag_name }}.bin | |
photon-lumenpnp-${{ github.event.release.tag_name }}.elf | |
- name: Compile Artifacts for Workflow Dispatch | |
if: github.event_name != 'release' | |
run: | | |
cd photon && pio run | |
cp .pio/build/lumenpnp-feeder/firmware.bin ../photon-lumenpnp-${{ env.SHORT_SHA }}.bin | |
cp .pio/build/lumenpnp-feeder/firmware.elf ../photon-lumenpnp-${{ env.SHORT_SHA }}.elf | |
- name: Upload Artifacts to Workflow Dispatch | |
if: github.event_name != 'release' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: photon-lumenpnp-${{ env.SHORT_SHA }}.bin | |
path: photon-lumenpnp-${{ env.SHORT_SHA }}.elf | |