diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 20e60f48..5b7a0ab6 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -61,6 +61,7 @@ jobs: - name: Zip build artifacts run: | mkdir -p /tmp/zipped_builds + rm -f /tmp/zipped_builds/*.zip if [ "${{ matrix.targetPlatform }}" == "StandaloneLinux64" ]; then cd build/StandaloneLinux64 zip -r /tmp/zipped_builds/build_StandaloneLinux64.zip . \ @@ -78,6 +79,19 @@ jobs: run: | ls -R /tmp/zipped_builds + - name: Determine tag name + id: tag + shell: bash + run: | + BUILD_NUMBER="$(git rev-list --count HEAD)" + SHORT_HASH="$(git rev-parse --short=7 HEAD)" + if [[ "${{ github.ref_name }}" == "main" ]]; then + echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT + else + SAFE_NAME=$(echo "${{ github.ref_name }}" | tr '/' '-') + echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT + fi + - name: Create Gitea Release and Upload Assets uses: akkuman/gitea-release-action@v1 env: @@ -85,8 +99,8 @@ jobs: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} with: server_url: ${{ github.server_url }} - tag_name: ${{ github.sha }} - name: Release ${{ github.sha }} + tag_name: ${{ steps.tag.outputs.name }} + name: Release ${{ steps.tag.outputs.name }} draft: false prerelease: false files: |