You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-29 22:27:42 +02:00
Fastfix
This commit is contained in:
140
.github/workflows/apt.yml
vendored
140
.github/workflows/apt.yml
vendored
@@ -1,140 +0,0 @@
|
|||||||
name: Update APT Repo
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup GPG
|
|
||||||
env:
|
|
||||||
GPG_PASSPHRASE: ${{ secrets.ENC_JSON }}
|
|
||||||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
||||||
run: |
|
|
||||||
# Создаем директорию GPG
|
|
||||||
mkdir -p ~/.gnupg
|
|
||||||
chmod 700 ~/.gnupg
|
|
||||||
|
|
||||||
# Настройка GPG для работы без терминала
|
|
||||||
cat <<EOF > ~/.gnupg/gpg.conf
|
|
||||||
batch
|
|
||||||
no-tty
|
|
||||||
use-agent
|
|
||||||
pinentry-mode loopback
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Сохраняем пароль во временный файл
|
|
||||||
echo "$GPG_PASSPHRASE" > ~/gpg-passphrase.txt
|
|
||||||
chmod 600 ~/gpg-passphrase.txt
|
|
||||||
|
|
||||||
# Импортируем приватный ключ
|
|
||||||
echo "$GPG_PRIVATE_KEY" | gpg --batch --pinentry-mode loopback --passphrase-file ~/gpg-passphrase.txt --import
|
|
||||||
|
|
||||||
# Проверяем, что ключ импортирован
|
|
||||||
gpg --list-secret-keys
|
|
||||||
|
|
||||||
# Удаляем пароль из файловой системы
|
|
||||||
rm ~/gpg-passphrase.txt
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y reprepro nginx gnupg
|
|
||||||
|
|
||||||
- name: Find and download correct .deb file
|
|
||||||
run: |
|
|
||||||
REPO_NAME="${{ github.repository }}"
|
|
||||||
|
|
||||||
# Получаем ID последнего релиза
|
|
||||||
LATEST_RELEASE_JSON=$(mktemp)
|
|
||||||
curl -s -H "Authorization: Bearer ${{ secrets.TOKEN }}" \
|
|
||||||
-H "Accept: application/vnd.github+json" \
|
|
||||||
"https://api.github.com/repos/$REPO_NAME/releases/latest" > "$LATEST_RELEASE_JSON"
|
|
||||||
|
|
||||||
RELEASE_ID=$(jq -r '.id' "$LATEST_RELEASE_JSON")
|
|
||||||
if [[ "$RELEASE_ID" == "null" ]]; then
|
|
||||||
echo "❌ Failed to get release ID"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Получаем список ассетов
|
|
||||||
ASSET_JSON=$(mktemp)
|
|
||||||
curl -s -H "Authorization: Bearer ${{ secrets.TOKEN }}" \
|
|
||||||
-H "Accept: application/vnd.github+json" \
|
|
||||||
"https://api.github.com/repos/$REPO_NAME/releases/$RELEASE_ID/assets" > "$ASSET_JSON"
|
|
||||||
|
|
||||||
# Ищем первый файл, подходящий под маску 'oint_*_all_ru.deb'
|
|
||||||
FILENAME=$(jq -r '.[] | select(.name | startswith("oint_") and endswith("_all_ru.deb")) | .name' "$ASSET_JSON" | head -n 1)
|
|
||||||
|
|
||||||
if [[ -z "$FILENAME" || "$FILENAME" == "null" ]]; then
|
|
||||||
echo "❌ No matching file found (mask: oint_*_all_ru.deb)"
|
|
||||||
echo "📎 Available assets:"
|
|
||||||
jq -r '.[].name' "$ASSET_JSON"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "📎 Selected file: $FILENAME"
|
|
||||||
|
|
||||||
# Получаем URL файла
|
|
||||||
ASSET_URL=$(jq -r ".[] | select(.name == \"$FILENAME\") | .url" "$ASSET_JSON")
|
|
||||||
|
|
||||||
# Скачиваем .deb
|
|
||||||
echo "📥 Downloading: $FILENAME"
|
|
||||||
curl -L -o "oint.deb" \
|
|
||||||
-H "Authorization: Bearer ${{ secrets.TOKEN }}" \
|
|
||||||
-H "Accept: application/octet-stream" \
|
|
||||||
"$ASSET_URL"
|
|
||||||
|
|
||||||
# Проверяем, что это настоящий .deb
|
|
||||||
echo "🔍 Verifying file type..."
|
|
||||||
file "oint.deb"
|
|
||||||
ar tvf "oint.deb" || echo "⚠️ This may not be a valid .deb file!"
|
|
||||||
|
|
||||||
- name: Setup repo structure
|
|
||||||
run: |
|
|
||||||
mkdir -p oint/{conf,dists,pool/main}
|
|
||||||
cat <<EOT > oint/conf/distributions
|
|
||||||
Origin: bayselonarrend
|
|
||||||
Label: oint
|
|
||||||
Suite: stable
|
|
||||||
Codename: focal
|
|
||||||
Architectures: amd64
|
|
||||||
Components: main
|
|
||||||
Description: OpenIntegrations CLI repo
|
|
||||||
SignWith: ${{ secrets.GPG_KEY_ID }}
|
|
||||||
EOT
|
|
||||||
|
|
||||||
- name: Add package to repo
|
|
||||||
env:
|
|
||||||
GPG_PASSPHRASE: ${{ secrets.ENC_JSON }}
|
|
||||||
run: |
|
|
||||||
cd oint
|
|
||||||
|
|
||||||
# Установить максимальное доверие к ключу
|
|
||||||
echo "${{ secrets.GPG_KEY_ID }}:6:" | gpg --import-ownertrust
|
|
||||||
|
|
||||||
# Добавляем пакет в репозиторий с подробным логом
|
|
||||||
GPG="gpg --verbose --pinentry-mode loopback --passphrase=$GPG_PASSPHRASE" \
|
|
||||||
reprepro includedeb focal ../oint.deb
|
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
run: |
|
|
||||||
cd oint
|
|
||||||
git init
|
|
||||||
git config user.name "Vitaly the Alpaca (bot) "
|
|
||||||
git config user.email "vitaly.the.alpaca@gmail.com"
|
|
||||||
git add .
|
|
||||||
git commit -m "Update APT repo"
|
|
||||||
git branch -M gh-pages
|
|
||||||
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
|
||||||
git push -f origin gh-pages
|
|
||||||
|
|
||||||
- name: Cleanup
|
|
||||||
run: |
|
|
||||||
rm -rf oint
|
|
||||||
BIN
public.key
BIN
public.key
Binary file not shown.
Reference in New Issue
Block a user