Skip to content

Commit

Permalink
Build updates, artifact name
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdowling committed Sep 6, 2022
1 parent 1bec3a7 commit 70ac563
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/firmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- 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-
- uses: actions/checkout@v3

- name: Setup env
run: |
echo "OC_ARTIFACT_TAG=${GITHUB_REF_NAME}-$(software/o_c_REV/resources/oc_build_tag.sh)" | tr '/' '_' >> $GITHUB_ENV
- 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
uses: actions/setup-python@v3
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: '**/requirements.txt'

- name: Build firmware
working-directory: software/o_c_REV/
run: pio run -e oc_prod
- run: |
pip3 install --upgrade pip
pip3 install -r .github/workflows/requirements.txt
- name: Build flipped firmware
- name: Build firmware
working-directory: software/o_c_REV/
run: pio run -e oc_prod_180
run: |
pio run -e oc_prod
pio run -e oc_prod_180
- name: Copy artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: o_C-${{github.sha}}
name: o_C-${{env.OC_ARTIFACT_TAG}}
path: software/o_c_REV/.pio/build/*/*.hex
1 change: 1 addition & 0 deletions .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
platformio
4 changes: 2 additions & 2 deletions software/o_c_REV/resources/oc_build_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
git_rev="$(git rev-parse --short HEAD)"
git_status="$(git status -s --untracked-files=no)"

if [[ -n "$git_status" ]] ; then
if [ -n "$git_status" ] ; then
suffix="dirty"
fi

echo "$git_rev $suffix"
echo "${git_rev}${suffix}"

0 comments on commit 70ac563

Please sign in to comment.