forked from SberHome/bdk_freertos_old
-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (57 loc) · 1.78 KB
/
platformio-package.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
name: Deploy PlatformIO package
on:
workflow_dispatch:
inputs:
ref:
description: Upstream ref
required: false
default: ''
version:
description: Package version
required: false
default: ''
permissions:
contents: write
jobs:
deploy:
name: Deploy PlatformIO package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: bekencorp/bdk_freertos
ref: ${{ inputs.ref }}
- name: Generate version number
id: version
run: |
echo version=$(date -d $(git log -1 --format=%cs) +v%Y.%m.%d) >> $GITHUB_OUTPUT
- name: Write package.json
uses: jsdaniell/[email protected]
env:
name: framework-beken-bdk
version: ${{ inputs.version || steps.version.outputs.version }}
description: Beken Development Kit for FreeRTOS
with:
name: package.json
json: ${{ toJSON(env) }}
- name: Cleanup repository
run: |
git checkout -B platformio
rm -rf application.mk
rm -rf beken378/*.mk
rm -rf Makefile
rm -rf release/doc/
rm -rf tools/
- name: Commit and push changes
env:
version: ${{ inputs.version || steps.version.outputs.version }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add .
git commit -m "[${{ env.version }}] Prepare PlatformIO package"
git tag ${{ env.version }}
git remote set-url origin https://github.com/${{ github.repository }}
git push --force origin platformio
git push origin ${{ env.version }}