-
Notifications
You must be signed in to change notification settings - Fork 7
96 lines (81 loc) · 3.31 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: PlatformIO CI
on: [push]
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.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: write temp file with build number and set to env variable
run: |
mv .pio/build/esp12e/firmware.bin .pio/build/esp12e/dtuGateway_snapshot_${{github.run_number}}.bin
# touch ${{ github.workspace }}/include/buildnumber.txt
# printf -v BUILDNUMBER "%04ddev" ${{github.run_number}}
# echo $BUILDNUMBER >> ${{ github.workspace }}/hooks/buildnumber.txt
# echo "cat ../buildnumber.txt"
# cat ${{ github.workspace }}/hooks/buildnumber.txt
# echo "CURRENT_BUILDNUMBER=$BUILDNUMBER" >> $GITHUB_ENV
- name: Build PlatformIO Project
run: pio run
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: .pio/build/esp12e/dtuGateway_snapshot_${{github.run_number}}.bin
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "snapshot"
prerelease: true
title: "Latest snapshot"
files: |
.pio/build/esp12e/dtuGateway_snapshot_${{github.run_number}}.bin
include/version.json
# - name: Update nightly release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: .pio/build/esp12e/firmware.bin
# asset_name: dtuGateway_snapshot.bin
# tag: devRelease
# overwrite: true
# - name: Update nightly release 2
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: include/version.json
# asset_name: snapshot.json
# tag: devRelease
# overwrite: true
# body: "dev release based on direct pushes"
# - name: Create Dev Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: devRelease
# release_name: dev drop
# body: |
# dev release based on direct pushes
# draft: true
# prerelease: false
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: .pio/build/esp12e/firmware.bin
# asset_name: dtuGatewayFirmware_${{github.run_number}}.bin
# asset_content_type: application/x-binary