Update versioning.yml #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Set Lib Version | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
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: 'Get tag' | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: 1.0.0 # Optional fallback tag to use when no tag can be found | |
- name: Overwrite version.h | |
uses: "DamianReeves/write-file-action@master" | |
with: | |
path: src/version.cpp | |
write-mode: overwrite | |
contents: | | |
#include "AsyncFsWebServer.h" | |
const char* AsyncFsWebServer::getVersion() { | |
return "${{ steps.previoustag.outputs.tag }}"; | |
} | |
- name: Commit & Push changes | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.MY_SECRET_TOKEN }} | |
author_email: [email protected] | |
branch: master | |
force: true |