Skip to content

Commit

Permalink
Fix PR build workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero committed Aug 3, 2022
1 parent 7f6a176 commit 6476ee2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build

on: [push, pull_request]
on: pull_request

jobs:
build-upload:
Expand All @@ -19,5 +19,8 @@ jobs:
sudo apt-get update
sudo apt-get -y install libusb-1.0-0 cmake srecord
pip install -U pyserial
- name: Build
env:
PR_NUMBER: ${{ github.event.number }}
run: ./scripts/build-firmware
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ private

# NodeMCU
nodemcu-firmware

# IDE's
.vscode
8 changes: 6 additions & 2 deletions scripts/build-firmware
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ function usage() {
set -e

if ! git describe --exact-match --tags &> /dev/null; then
BRANCH="$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')"
if [[ -z "${PR_NUMBER}" ]]; then
BRANCH="$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')"
else
BRANCH="PR-"${PR_NUMBER}
fi
else
BRANCH="$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))"
BRANCH="$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))"
fi

FW_TAG="3.0.0-release_20210201"
Expand Down

0 comments on commit 6476ee2

Please sign in to comment.