Merge pull request #48 from umts/sntp-changes #83
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: Version Check | |
on: | |
push: | |
branches: [stop_73, stop_414, stop_1670] | |
jobs: | |
version_check: | |
runs-on: ubuntu-latest | |
outputs: | |
vup: ${{ steps.version_up.outputs.vup }} | |
vtag: ${{ steps.version_tag.outputs.vtag }} | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: 'app/VERSION' | |
fetch-depth: '2' | |
- name: Check for version update | |
id: version_up | |
run: | | |
vers=$(git show HEAD~:app/VERSION | awk 'ORS=" "{print $3}' - app/VERSION) | |
vup=$(echo $vers | awk '{print (($6 > $1) || ($7 > $2) || ($8 > $3)) ? "true" : "false"}') | |
echo "vup=$vup" >> "$GITHUB_OUTPUT" | |
echo "Version increased: $vup" >> $GITHUB_STEP_SUMMARY | |
- name: Create version tag | |
if: steps.version_up.outputs.vup == 'true' | |
id: version_tag | |
run: | | |
tag=v$(awk 'NR<4{printf "%s%s", sep, $3; sep="."} END{print ""}' app/VERSION) | |
echo "vtag=$tag" >> "$GITHUB_OUTPUT" | |
echo "Version tag: $tag" >> $GITHUB_STEP_SUMMARY | |
release: | |
if: needs.version_check.outputs.vup == 'true' | |
needs: version_check | |
uses: ./.github/workflows/release.yml | |
with: | |
version_tag: ${{ needs.version_check.outputs.vtag }} | |
secrets: inherit | |
build: | |
if: needs.version_check.outputs.vup == 'false' | |
needs: version_check | |
uses: ./.github/workflows/build.yml | |
with: | |
release_build: false | |
secrets: inherit |