-
-
Notifications
You must be signed in to change notification settings - Fork 38
87 lines (82 loc) · 2.69 KB
/
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: build
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure changelog is updated
uses: dangoslen/[email protected]
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%y.%-m.%-d')"
- name: Test with environment variables
run: echo $TAG_NAME - $RELEASE_NAME
env:
TAG_NAME: ${{ steps.date.outputs.date }}
RELEASE_NAME: ${{ steps.date.outputs.date }}-
- uses: rickstaa/action-create-tag@v1
with:
tag: ${{ steps.date.outputs.date }}
message: "Automatic release ${{ steps.date.outputs.date }}"
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
software:
- '!(Hardware/**)'
hardware:
- 'Hardware/**'
- name: Show python version
run: python --version
- name: Install PlatformIO
run: python -m pip install platformio
- name: Check pre-commit hooks
uses: pre-commit/[email protected]
- name: Build firmware
run: platformio run
- name: Build filesystem
run: platformio run --target buildfs
- name: Create artifacts
run: |
7z a SmartSpin2kFirmware-${{ steps.date.outputs.date }}.bin.zip ./.pio/build/release/*.bin
- name: Archive
uses: actions/upload-artifact@v4
with:
name: all-artifacts
path: SmartSpin2kFirmware-${{ steps.date.outputs.date }}.bin.zip
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: all-artifacts
- name: Get tag info
id: tag_info
run: echo ::set-output name=SOURCE_TAG::${{ steps.date.outputs.date }}
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_info.outputs.SOURCE_TAG }}
name: SmartSpin2k ${{ steps.tag_info.outputs.SOURCE_TAG }}
draft: false
prerelease: false
generate_release_notes: true
body: ${{ github.event.head_commit.message }}
files: |
SmartSpin2kFirmware-${{ steps.date.outputs.date }}.bin.zip
update-changelog:
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@v1
with:
version: ${{ steps.date.outputs.date }}