Skip to content

Commit f89a334

Browse files
committed
build on every push
1 parent d2789e7 commit f89a334

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

Diff for: .github/workflows/build.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build
22

3-
on: pull_request
3+
on: push
44

55
jobs:
66
build-upload:
@@ -20,16 +20,19 @@ jobs:
2020
sudo apt-get -y install libusb-1.0-0 cmake srecord
2121
pip install -U pyserial
2222
23-
- name: Build
23+
- id: build
24+
name: Build
2425
env:
25-
PR_NUMBER: ${{ github.event.number }}
26-
run: ./scripts/build-firmware
26+
SHA: ${{ github.event.head }}
27+
run: |
28+
fname=$(./scripts/build-firmware | tail -1)
29+
echo "::set-output fname=fname::$fname"
2730
2831
- uses: keithweaver/[email protected]
29-
name: Copy PR bin to AWS
32+
name: Copy build to AWS
3033
with:
3134
command: cp
32-
source: build/konnected-esp8266-PR-${{ github.event.number }}.bin
35+
source: build/${{ steps.build.outputs.fname }}
3336
destination: s3://konnected-io/builds/
3437
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
3538
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Diff for: scripts/build-firmware

+4-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ function usage() {
1515
set -e
1616

1717
if ! git describe --exact-match --tags &> /dev/null; then
18-
if [[ -z "${PR_NUMBER}" ]]; then
19-
BRANCH="$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')"
20-
else
21-
BRANCH="PR-"${PR_NUMBER}
22-
fi
18+
BRANCH="$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')"
2319
else
2420
BRANCH="$(git describe --exact-match --tags $(git log -n1 --pretty='%h'))"
2521
fi
@@ -108,9 +104,11 @@ echo
108104

109105
# Build full image
110106
srec_cat -output "${OUTPUT_BASE}/konnected-esp8266-${BRANCH}.bin" -binary "${OUTPUT_BASE}/${IMAGE_NAME}.bin" -binary -fill 0xff 0x0000 0x100000 "${OUTPUT_BASE}/konnected-filesystem-0x100000-${BRANCH}.img" -binary -offset 0x100000
107+
echo "Wrote ${OUTPUT_BASE}/konnected-esp8266-${BRANCH}.bin"
111108

112109
# Copy to common name for ease of flashing
113110
cp "${OUTPUT_BASE}/konnected-esp8266-${BRANCH}.bin" "${OUTPUT_BASE}/konnected-esp8266-latest.bin"
114111

115-
echo "Build Complete: Flash this build with './scripts/flash ${BRANCH} <port>'"
112+
echo "Build Complete:Flash this build with './scripts/flash ${BRANCH} <port>'"
113+
echo "konnected-esp8266-${BRANCH}.bin"
116114

0 commit comments

Comments
 (0)