Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
cotestatnt committed Jan 7, 2024
2 parents 69b3636 + ecb84ae commit 6e111cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,37 @@ on:
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:
fetch-depth: 0 # Required due to the way Git works
- name: 'Get tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
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:
fallback: 1.0.0 # Optional fallback tag to use when no tag can be found
path: 'library.properties'
properties: 'version'

- name: Overwrite version.h
uses: "DamianReeves/write-file-action@master"
with:
path: version.h
path: src/version.cpp
write-mode: overwrite
contents: |
const char* getVersion() {return "${{ steps.previoustag.outputs.tag }}";}
#include "AsyncFsWebServer.h"
const char* AsyncFsWebServer::getVersion() {
return "${{ steps.read_property.outputs.version }}";
}
- name: Commit & Push
uses: Andro999b/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
force: true
message: 'Overwritten by Github Actions - ${date}'
message: 'Overwritten by Github Actions'
7 changes: 3 additions & 4 deletions src/version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "AsyncFsWebServer.h"

const char* AsyncFsWebServer::getVersion() {
return "1.0.4";
#include "AsyncFsWebServer.h"
const char* AsyncFsWebServer::getVersion() {
return "1.0.4";
}

0 comments on commit 6e111cd

Please sign in to comment.