1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-02 00:10:22 +02:00

Disable patch version for releases

This commit is contained in:
nordsoft 2022-12-23 12:10:05 +04:00 committed by Nordsoft91
parent b84e0775b3
commit 25803b3c3a
3 changed files with 21 additions and 6 deletions

View File

@ -5,6 +5,7 @@ on:
branches: branches:
- features/* - features/*
- beta - beta
- master
pull_request: pull_request:
schedule: schedule:
- cron: '0 2 * * *' - cron: '0 2 * * *'
@ -159,6 +160,7 @@ jobs:
fi fi
echo VCMI_PACKAGE_FILE_NAME="$VCMI_PACKAGE_FILE_NAME" >> $GITHUB_ENV echo VCMI_PACKAGE_FILE_NAME="$VCMI_PACKAGE_FILE_NAME" >> $GITHUB_ENV
echo VCMI_PACKAGE_NAME_SUFFIX="$VCMI_PACKAGE_NAME_SUFFIX" >> $GITHUB_ENV echo VCMI_PACKAGE_NAME_SUFFIX="$VCMI_PACKAGE_NAME_SUFFIX" >> $GITHUB_ENV
echo VCMI_PACKAGE_GITVERSION="$VCMI_PACKAGE_GITVERSION" >> $GITHUB_ENV
env: env:
PULL_REQUEST: ${{ github.event.pull_request.number }} PULL_REQUEST: ${{ github.event.pull_request.number }}
@ -172,7 +174,8 @@ jobs:
${{matrix.cmake_args}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ ${{matrix.cmake_args}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DENABLE_TEST=${{matrix.test}} \ -DENABLE_TEST=${{matrix.test}} \
-DPACKAGE_NAME_SUFFIX:STRING="$VCMI_PACKAGE_NAME_SUFFIX" \ -DPACKAGE_NAME_SUFFIX:STRING="$VCMI_PACKAGE_NAME_SUFFIX" \
-DPACKAGE_FILE_NAME:STRING="$VCMI_PACKAGE_FILE_NAME" -DPACKAGE_FILE_NAME:STRING="$VCMI_PACKAGE_FILE_NAME" \
-DENABLE_GITVERSION="$VCMI_PACKAGE_GITVERSION"
env: env:
CC: ${{ matrix.cc }} CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }} CXX: ${{ matrix.cxx }}
@ -223,7 +226,7 @@ jobs:
${{github.workspace}}/**/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }} ${{github.workspace}}/**/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
- name: Upload build - name: Upload build
if: ${{ matrix.pack == 1 && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || startsWith(github.ref, 'refs/heads/features/')) && matrix.platform != 'msvc' }} if: ${{ matrix.pack == 1 && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/features/')) && matrix.platform != 'msvc' }}
run: | run: |
cd '${{github.workspace}}/out/build/${{matrix.preset}}' cd '${{github.workspace}}/out/build/${{matrix.preset}}'
source '${{github.workspace}}/CI/upload_package.sh' source '${{github.workspace}}/CI/upload_package.sh'
@ -241,7 +244,7 @@ jobs:
- name: Trigger Android - name: Trigger Android
uses: peter-evans/repository-dispatch@v1 uses: peter-evans/repository-dispatch@v1
if: ${{ github.ref == 'refs/heads/develop' && matrix.platform == 'mxe' }} if: ${{ (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master') && matrix.platform == 'mxe' }}
with: with:
token: ${{ secrets.VCMI_ANDROID_ACCESS_TOKEN }} token: ${{ secrets.VCMI_ANDROID_ACCESS_TOKEN }}
repository: vcmi/vcmi-android repository: vcmi/vcmi-android

View File

@ -27,16 +27,27 @@ fi
VCMI_PACKAGE_FILE_NAME="${TMP_JOBID}-vcmi" VCMI_PACKAGE_FILE_NAME="${TMP_JOBID}-vcmi"
VCMI_PACKAGE_NAME_SUFFIX="" VCMI_PACKAGE_NAME_SUFFIX=""
VCMI_PACKAGE_GITVERSION="ON"
if [ -z "$TMP_PRID" ] || [ "$TMP_PRID" == "false" ]; if [ -z "$TMP_PRID" ] || [ "$TMP_PRID" == "false" ];
then then
branch_name=$(echo "$TMP_BRANCH" | sed 's/[^[:alnum:]]\+/_/g') branch_name=$(echo "$TMP_BRANCH" | sed 's/[^[:alnum:]]\+/_/g')
VCMI_PACKAGE_FILE_NAME="${VCMI_PACKAGE_FILE_NAME}-branch-${branch_name}-${TMP_COMMIT}" VCMI_PACKAGE_FILE_NAME="${VCMI_PACKAGE_FILE_NAME}-branch-${branch_name}-${TMP_COMMIT}"
VCMI_PACKAGE_NAME_SUFFIX="branch ${branch_name}" if [ "${branch_name}" != "master" ];
then
VCMI_PACKAGE_NAME_SUFFIX="branch ${branch_name}"
else
VCMI_PACKAGE_GITVERSION="OFF"
fi
else else
VCMI_PACKAGE_FILE_NAME="${VCMI_PACKAGE_FILE_NAME}-PR-${TMP_PRID}-${TMP_COMMIT}" VCMI_PACKAGE_FILE_NAME="${VCMI_PACKAGE_FILE_NAME}-PR-${TMP_PRID}-${TMP_COMMIT}"
VCMI_PACKAGE_NAME_SUFFIX="PR ${TMP_PRID}" VCMI_PACKAGE_NAME_SUFFIX="PR ${TMP_PRID}"
fi fi
VCMI_PACKAGE_NAME_SUFFIX="(${VCMI_PACKAGE_NAME_SUFFIX})"
if [ "${VCMI_PACKAGE_NAME_SUFFIX}" != "" ];
then
VCMI_PACKAGE_NAME_SUFFIX="(${VCMI_PACKAGE_NAME_SUFFIX})"
fi
export VCMI_PACKAGE_FILE_NAME export VCMI_PACKAGE_FILE_NAME
export VCMI_PACKAGE_NAME_SUFFIX export VCMI_PACKAGE_NAME_SUFFIX
export VCMI_PACKAGE_GITVERSION

View File

@ -23,7 +23,8 @@
"PACKAGE_FILE_NAME" : "$env{VCMI_PACKAGE_FILE_NAME}", "PACKAGE_FILE_NAME" : "$env{VCMI_PACKAGE_FILE_NAME}",
"PACKAGE_NAME_SUFFIX" : "$env{VCMI_PACKAGE_NAME_SUFFIX}", "PACKAGE_NAME_SUFFIX" : "$env{VCMI_PACKAGE_NAME_SUFFIX}",
"CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_BUILD_TYPE": "RelWithDebInfo",
"ENABLE_TEST": "OFF" "ENABLE_TEST": "OFF",
"ENABLE_GITVERSION": "$env{VCMI_PACKAGE_GITVERSION}"
} }
}, },
{ {