-
-
Notifications
You must be signed in to change notification settings - Fork 25
73 lines (69 loc) · 2.18 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build CapibaraZero firmware
on: [push]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Prepare Duktape library
run: bash init_libs.sh
- name: Build for all boards
run: pio run
- name: Prepare firmware folder
run: bash prepare_image_all.sh
- name: Upload firmware to artifact
uses: actions/upload-artifact@v4
with:
name: firmware
path: firmware/
- name: Generate release tag
run: echo TAG_NAME=$(cat TAG)-$(date +"%Y_%m_%d_%S") >> $GITHUB_ENV
- name: Create release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/heads/develop')
with:
tag_name: ${{ env.TAG_NAME }}
target_commitish: ${{ github.ref }}
name: "CapibaraZero ${{ github.ref }} beta"
make_latest: true
prerelease: true
files: release/*
release:
runs-on: ubuntu-latest
needs: build
steps:
# - uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
repository: "capibaraZero/Web-Flasher"
ref: 'main'
token: ${{ secrets.WEB_FLASHER_TOKEN }}
- uses: actions/download-artifact@v4
with:
name: firmware
path: firmware/
- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Copy beta firmware
if: startsWith(github.ref, 'refs/heads/develop')
run: bash get_firmware.sh latest_beta
- name: Copy stable firmware
if: startsWith(github.ref, 'refs/heads/main')
run: bash get_firmware.sh latest_stable
- name: Push changes
run: git add public/ && git commit -m "Update firmware to latest" && git push origin main