-
Notifications
You must be signed in to change notification settings - Fork 29
46 lines (43 loc) · 1.44 KB
/
set_version.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
name: Set Lib Version
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Read value from Properties-file
id: read_property
uses: christian-draeger/[email protected]
with:
path: 'library.properties'
properties: 'version'
- name: Overwrite src/Version.cpp
uses: "DamianReeves/write-file-action@master"
with:
path: src/Version.cpp
write-mode: overwrite
contents: |
#ifndef esp_fs_version_cpp
#define esp_fs_version_cpp
#include "esp-fs-webserver.h"
const char* FSWebServer::getVersion() {
return "${{ steps.read_property.outputs.version }}";
}
#endif
- name: Commit & Push
uses: Andro999b/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
force: true
message: 'Overwritten by Github Actions'