Skip to content

Commit

Permalink
set version workflow #41
Browse files Browse the repository at this point in the history
ukorvl authored and nkaskov committed Aug 8, 2022
1 parent b905308 commit c890f54
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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 c890f54

Please sign in to comment.