1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-06-12 00:34:16 +02:00

Доработка CI

This commit is contained in:
Anton Titovets
2026-02-25 13:54:12 +03:00
parent 48c0b2c4ac
commit fa4e1908b1
2 changed files with 40 additions and 6 deletions
+34 -6
View File
@@ -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)"
+6
View File
@@ -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.ЗапуститьВнешнееПриложение(ТекущаяКоманда);