-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.33 KB
/
main.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
name: CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
tags: ["v*.*.*"]
pull_request:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# ensure we have the python version required for Platform IO.
- uses: actions/setup-python@v4
with:
python-version: "3.11"
# for CI builds. edit version.h to contain the branch name
- name: write version.h
run: |
export BRANCH_OR_TAG=${GITHUB_REF#refs/*/}
echo BRANCH_OR_TAG
echo "#define VERSION \"${BRANCH_OR_TAG}\"" > version.h
cat version.h
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build PlatformIO Project
run: |
mkdir output
cd firmware
pio run
cp .pio/build/featheresp32/firmware.bin ../output/firmware.bin
# publish tags as releases.
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: output/*