-
Notifications
You must be signed in to change notification settings - Fork 11
72 lines (65 loc) · 2.06 KB
/
workflow.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
name: Build, release, update
permissions:
contents: write
on:
workflow_dispatch:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build_firmware:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install Node JS
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio==6.1.11
- name: Build PlatformIO Project
run: pio run
- name: Get Release Version
id: get_version
shell: bash
run: |
value=`cat tools/version`
echo "version=$value" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: echo "date=$(date +'%d%m%y')" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
name: "v${{ steps.get_version.outputs.version }} (${{ steps.date.outputs.date }})"
files: |
bin/UZG-01.bin
bin/UZG-01_v${{ steps.get_version.outputs.version }}.full.bin
- name: Updare version in manifest.json
run: |
sed -r 's/v[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}/v${{ steps.get_version.outputs.version }}/g' manifest.json > new.manifest.json
- name: Move file
shell: bash
run: |
echo "old"
cat manifest.json
mv -f new.manifest.json manifest.json
echo "new"
cat manifest.json
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'Release v${{ steps.get_version.outputs.version }} (${{ steps.date.outputs.date }})'