diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 9209304c69..47be3f3143 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -1,10 +1,10 @@ -name: Update Stable Branch on Release or Update +name: Update Stable Branch on Latest Release Update on: release: types: - published - - updated + - edited jobs: update-stable: @@ -13,18 +13,46 @@ jobs: contents: write steps: - - name: Checkout main branch + - name: Checkout repository uses: actions/checkout@v4 with: - ref: main - fetch-depth: 0 # Полная история для force push + fetch-depth: 0 - name: Configure Git user run: | git config --local user.email "vitaly.the.alpaca@gmail.com" git config --local user.name "Vitaly the Alpaca (bot)" - - name: Force update stable branch to match main + - name: Check if this is the latest release and update stable + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_TAG: ${{ github.event.release.tag_name }} run: | + echo "🔍 Checking release information..." + echo "Current release tag: $RELEASE_TAG" + + LATEST_RELEASE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/releases/latest" | \ + jq -r '.tag_name') + + echo "Latest release tag: $LATEST_RELEASE" + + if [ "$RELEASE_TAG" != "$LATEST_RELEASE" ]; then + echo "⚠️ This is not the latest release. Skipping stable branch update." + exit 0 + fi + + echo "✓ This is the latest release!" + echo "📦 Updating stable branch to release commit..." + + git fetch --tags --force + git checkout "$RELEASE_TAG" + + COMMIT_SHA=$(git rev-parse HEAD) + echo "Release commit SHA: $COMMIT_SHA" + git checkout -B stable git push --force origin stable + + echo "✅ Stable branch successfully updated to $RELEASE_TAG ($COMMIT_SHA)" \ No newline at end of file diff --git a/ci/os/internal/Classes/IBUpdater.os b/ci/os/internal/Classes/IBUpdater.os index 68a1992040..2cdccb775a 100644 --- a/ci/os/internal/Classes/IBUpdater.os +++ b/ci/os/internal/Classes/IBUpdater.os @@ -15,6 +15,8 @@ ДанныеПроекта = ДанныеПроекта_; КонецЕсли; + CommonTools.СообщитьПроцесс("1C IB Updating"); + Путь1С = ДанныеПроекта.ПолучитьЗначениеНастройки("local.onecConfig"); ИмяСервера = ДанныеПроекта.ПолучитьЗначениеНастройки("local.serverName"); КаталогEDT = ДанныеПроекта.ПолучитьЗначениеНастройки("local.edtProjectsPath"); @@ -46,6 +48,8 @@ , СтрШаблон("%1%2/%3", Корень, Язык, "OPI") , КаталогСборки); + CommonTools.СообщитьПроцесс(СтрШаблон("EDT project export for %1...", Язык)); + ВыводЭкспорт = CommonTools.ЗапуститьВнешнееПриложение(КомандаЭкспорта); ВыводЭкспорт = нРег(ВыводЭкспорт); @@ -57,6 +61,8 @@ ЗаменитьCRLF(КаталогСборки); + CommonTools.СообщитьПроцесс(СтрШаблон("1С batch updating for...", Язык)); + ТекущаяКоманда = СтрШаблон("""%1"" DESIGNER /IBName ""%2"" /LoadConfigFromFiles ""%3"" -Extension OpenIntegrations", Путь1С, ИмяИБ, КаталогСборки); CommonTools.ЗапуститьВнешнееПриложение(ТекущаяКоманда);