-
Notifications
You must be signed in to change notification settings - Fork 7
71 lines (59 loc) · 2.58 KB
/
dev_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: PlatformIO CI snapshot release
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: write temp file with build number and set to env variable
run: |
touch ${{ github.workspace }}/include/buildnumber.txt
printf -v BUILDNUMBER "%04d" ${{github.run_number}}
echo "${BUILDNUMBER}_${{ steps.extract_branch.outputs.branch }}" >> ${{ github.workspace }}/include/buildnumber.txt
echo "got current buildnumber and saved: "
cat ${{ github.workspace }}/include/buildnumber.txt
echo "CURRENT_BUILDNUMBER=$BUILDNUMBER" >> $GITHUB_ENV
- name: Build PlatformIO Project
run: pio run
- name: got current version and changing firmware name after building
run: |
VERSIONNUMBER=$(python ${{ github.workspace }}/version_inc.py getversion 2>&1)
echo "got versionnumber: " $VERSIONNUMBER
echo "CURRENT_VERSIONNUMBER=$VERSIONNUMBER" >> $GITHUB_ENV
mv .pio/build/esp12e/firmware.bin .pio/build/dtuGateway_ESP8266_snapshot_$VERSIONNUMBER.bin
mv .pio/build/esp32/firmware.bin .pio/build/dtuGateway_ESP32_snapshot_$VERSIONNUMBER.bin
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dtuGateway_snapshot_${{ env.CURRENT_VERSIONNUMBER }}
path: |
.pio/build/dtuGateway_ESP8266_snapshot_${{ env.CURRENT_VERSIONNUMBER }}.bin
.pio/build/dtuGateway_ESP32_snapshot_${{ env.CURRENT_VERSIONNUMBER }}.bin
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "snapshot"
prerelease: true
title: "Latest snapshot v${{ env.CURRENT_VERSIONNUMBER }}"
files: |
.pio/build/dtuGateway_ESP8266_snapshot_${{ env.CURRENT_VERSIONNUMBER }}.bin
.pio/build/dtuGateway_ESP32_snapshot_${{ env.CURRENT_VERSIONNUMBER }}.bin
include/version.json