diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6696c95..301ad95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ name: Build -on: [push, pull_request] +on: pull_request jobs: build-upload: @@ -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 diff --git a/.gitignore b/.gitignore index 8c03d32..920a7d8 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,6 @@ private # NodeMCU nodemcu-firmware + +# IDE's +.vscode diff --git a/scripts/build-firmware b/scripts/build-firmware index 3e4ad96..11707e8 100755 --- a/scripts/build-firmware +++ b/scripts/build-firmware @@ -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"