Skip to content

Commit

Permalink
Merge pull request #46 from NilFoundation/41-set-version
Browse files Browse the repository at this point in the history
Automatic patch version update added
  • Loading branch information
nkaskov authored Aug 9, 2022
2 parents 210f17f + c890f54 commit 9bd82cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,25 @@ on:
branches: [ master ]

jobs:
autotag_version:
name: Auto tag version
set_version:
name: Set and tag version
runs-on: [ubuntu-latest]
env:
VERSION_FILE_NAME: VERSION
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check if version was changed
uses: technote-space/get-diff-action@v6
with:
FILES: ${{ env.VERSION_FILE_NAME }}
- name: Set version
id: set_version
run: |
version=$(cat ${{ env.VERSION_FILE_NAME }} | tr -d '\r').$GITHUB_RUN_NUMBER
echo "VERSION=$version" >> $GITHUB_ENV
- name: Tag new version
if: ${{ env.MATCHED_FILES }}
run: |
version=$(cat ${{ env.VERSION_FILE_NAME }} | tr -d '\r')
git tag v$version
run: git tag v${{ env.VERSION }}

- name: Push tags
if: ${{ env.MATCHED_FILES }}
uses: ad-m/github-push-action@master
with:
tags: true
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1
0.0

0 comments on commit 9bd82cc

Please sign in to comment.