update release process (#214)

Co-authored-by: Akolzin Dmitry <akolzin@retailcrm.ru>
This commit is contained in:
Akolzin Dmitry 2020-12-15 16:41:27 +03:00 committed by GitHub
parent 7ed233450c
commit 828cc72930
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,25 +221,29 @@ jobs:
export VERSION=`cat VERSION` export VERSION=`cat VERSION`
export ARCHIVE_NAME=retailcrm-$VERSION.ocmod.zip export ARCHIVE_NAME=retailcrm-$VERSION.ocmod.zip
export ARCHIVE_PATH=/tmp export ARCHIVE_PATH=/tmp
git config --local user.name "RetailCRM" export RELEASE_TAG=v$VERSION
git config --local user.email "support@retailcrm.ru" export LAST_COMMIT=`git log --oneline --format=%B -n 1 HEAD | head -n 1`
export TRAVIS_TAG=v$VERSION echo RELEASE_TAG=$RELEASE_TAG >> $GITHUB_ENV
git tag $TRAVIS_TAG echo LAST_TAG=$LAST_TAG >> $GITHUB_ENV
echo LAST_COMMIT=$LAST_COMMIT >> $GITHUB_ENV
echo ARCHIVE_PATH=$ARCHIVE_PATH >> $GITHUB_ENV
echo ARCHIVE_NAME=$ARCHIVE_NAME >> $GITHUB_ENV
make build_archive make build_archive
- name: Create Release - name: Create Release
id: create_release id: create_release
uses: actions/create-release@v1 uses: actions/create-release@v1
if: env.LAST_TAG != env.VERSION if: env.LAST_TAG != env.RELEASE_TAG
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: ${{ env.RELEASE_TAG }} tag_name: ${{ env.RELEASE_TAG }}
release_name: ${{ env.RELEASE_TAG }} release_name: ${{ env.RELEASE_TAG }}
body: ${{ env.LAST_COMMIT }}
draft: false draft: false
prerelease: false prerelease: false
- name: Upload Release Asset - name: Upload Release Asset
id: upload-release-asset id: upload-release-asset
if: env.LAST_TAG != env.VERSION if: env.LAST_TAG != env.RELEASE_TAG
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}