Skip to content

Commit

Permalink
CI: Fix git tag recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
tt2468 committed Aug 29, 2021
1 parent 0b02b74 commit 1849c39
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ jobs:
working-directory: ${{ github.workspace }}/obs-websocket
run: |
git fetch --prune --unshallow
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
if [ "${{ env.GIT_TAG }}" ] ; then \
VERSION="$(git describe --tags --abbrev=0)" ; \
GIT_HASH=$(git rev-parse --short HEAD)
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
GIT_TAG=$(git describe --tags --abbrev=0)
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV
if [ "$GIT_TAG" ] ; then \
VERSION="$GIT_TAG" ; \
else \
VERSION="$(git rev-parse --short HEAD)-git" ; \
VERSION="$GIT_HASH-git" ; \
fi
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
- name: 'Restore Cached Qt'
Expand Down Expand Up @@ -179,7 +181,7 @@ jobs:
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_HASH }}-Windows'
name: 'obs-websocket-${{ env.PACKAGE_VERSION }}-Windows'
path: ${{ github.workspace }}/obs-websocket/package/*.zip
- name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe'
if: success()
Expand Down Expand Up @@ -220,12 +222,14 @@ jobs:
working-directory: ${{ github.workspace }}/obs-websocket
run: |
git fetch --prune --unshallow
echo "GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
if [ "${{ env.GIT_TAG }}" ] ; then \
VERSION="$(git describe --tags --abbrev=0)" ; \
GIT_HASH=$(git rev-parse --short HEAD)
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
GIT_TAG=$(git describe --tags --abbrev=0)
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV
if [ "$GIT_TAG" ] ; then \
VERSION="$GIT_TAG" ; \
else \
VERSION="$(git rev-parse --short HEAD)-git" ; \
VERSION="$GIT_HASH-git" ; \
fi
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
- name: 'Install prerequisites (Apt)'
Expand Down

0 comments on commit 1849c39

Please sign in to comment.