Files
projman/.gitea/workflows/build.yml
svk 9eb32586c7
Some checks failed
Сборка Projman / build (push) Failing after 9s
Тесты сборки
2026-01-22 20:40:38 +03:00

69 lines
2.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Сборка Projman
on: [push]
jobs:
build:
runs-on: tcl-tk-builder
steps:
- name: Клонирование
run: |
git clone "${{ vars.main_url }}${{ gitea.repository }}.git" src
pwd
- name: Сборка пакетов
run: |
# cd src
echo "=== Сборка DEB ==="
cd debian
./build-deb-projman.sh
echo "=== Сборка OpenBSD ==="
cd ../openbsd
./build-package-bsd.sh
echo "=== Собранные файлы ==="
cd ../..
find src -name "*.deb" -o -name "*.tgz" | xargs ls -la
- name: Извлечение версии
id: get_version
run: |
cd src
VERSION=$(grep "Version" projman.tcl | head -1 | grep -o '[0-9.]\+')
RELEASE=$(grep "# Release" projman.tcl | tail -1 | awk '{print $NF}')
echo "version=$VERSION" >> $GITEA_OUTPUT
echo "release=$RELEASE" >> $GITEA_OUTPUT
- name: Создание релиза для тегов
if: startsWith(gitea.ref, 'refs/tags/')
run: |
# cd src
TAG_NAME="${GITEA_REF#refs/tags/}"
echo "=== Создание релиза $TAG_NAME ==="
# Создаем релиз
RESPONSE=$(curl -s -X POST \
-u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "'"$TAG_NAME"'",
"name": "Projman '"$TAG_NAME"'",
"body": "Версия: '"$VERSION"'\nРевизия: '"$RELEASE"'",
"draft": false
}' \
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases")
echo "Ответ: $RESPONSE"
# Извлекаем ID релиза
REL_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | cut -d: -f2)
# Загружаем файлы в релиз
for FILE in $(find . -name "projman*" -type f \( -name "*.deb" -o -name "*.tgz" \)); do
echo "Загружаем: $FILE"
curl -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
--upload-file "$FILE" \
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/$REL_ID/assets?name=$(basename $FILE)"
done