Compare commits
18 commits
release/0.
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c4546fec60 | |||
| 0ee3d21d7c | |||
| 98cfd6da94 | |||
| d7656bd261 | |||
| a7e7676897 | |||
| 936fc6ba2d | |||
| 47d8b2125b | |||
| 0af7608d0c | |||
| 8043eef048 | |||
| 3bb3eb19c8 | |||
| c4f0a695dc | |||
| 95f226bb7c | |||
| 5cd0a70aa1 | |||
| 8c957b0fe3 | |||
| 7bf34f498a | |||
| 631139e629 | |||
| 8cf457fa2e | |||
| f4bd09d735 |
2 changed files with 9 additions and 116 deletions
|
|
@ -1,127 +1,20 @@
|
||||||
when:
|
when:
|
||||||
event: [push, tag]
|
event: manual
|
||||||
branch: main
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
checkout:
|
checkout:
|
||||||
image: debian:latest
|
image: debian:latest
|
||||||
environment:
|
environment:
|
||||||
GONETS:
|
FORGEJO_TOKEN:
|
||||||
from_secret: GONETS
|
from_secret: forgejo_token
|
||||||
commands:
|
commands:
|
||||||
# ПОДГОТОВКА ГИТА И КЛОНИРОВАНИЕ GONETS
|
# ПОДГОТОВКА ГИТА И КЛОНИРОВАНИЕ GONETS
|
||||||
- apt update
|
- apt update
|
||||||
- apt install -y git git-lfs
|
- apt install -y git git-lfs
|
||||||
- git lfs install
|
- git lfs install
|
||||||
|
- git config --global user.email "s.galanskiy@gossys.dev"
|
||||||
# УСТАНОВКА НЕОБХОДИМЫХ ЗАВИСИМОСТЕЙ НА СИСТЕМЕ
|
- git config --global user.name "s.galanskiy"
|
||||||
- apt update
|
- touch file
|
||||||
- apt install -y python3 openssh-server tree libnss3 libnss3-dev libnspr4 libnspr4-dev libasound2 libasound2-dev python3.11-venv python3-pip python3-poetry nodejs npm debhelper devscripts build-essential fakeroot dh-make dpkg-dev cmake libgirepository1.0-dev gobject-introspection libcairo2-dev pkg-config python3-dev libdbus-1-dev
|
- git add .
|
||||||
- python3 --version
|
- git commit -m "commit"
|
||||||
- node -v
|
- git push https://$FORGEJO_TOKEN@dev.gossys.dev/s.galanskiy/gonets.git
|
||||||
- npm -v
|
|
||||||
|
|
||||||
# ПОДГОТОВКА СПИСКА PYTHON ЗАВИСИМОСТЕЙ GONETS
|
|
||||||
- rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
|
|
||||||
- rm -rf /root/.local/share/pypoetry
|
|
||||||
- rm -rf /root/.poetry
|
|
||||||
- rm -rf /usr/bin/poetry
|
|
||||||
- pip install pipx
|
|
||||||
- pipx ensurepath
|
|
||||||
- pipx install poetry
|
|
||||||
- echo 'export PATH="$HOME/.local/bin:$PATH"' >> /root/.bashrc
|
|
||||||
- . /root/.bashrc
|
|
||||||
- poetry --version
|
|
||||||
- cd SRV
|
|
||||||
- poetry env activate
|
|
||||||
- poetry add poetry-plugin-export
|
|
||||||
- poetry install
|
|
||||||
- poetry self update
|
|
||||||
- rm -f requirements.txt
|
|
||||||
- poetry run poetry export -f requirements.txt --output requirements.txt --without-hashes
|
|
||||||
|
|
||||||
# ПОДГОТОВКА И СБОРКА FRONTEND ЧАСТИ GONETS
|
|
||||||
- pwd
|
|
||||||
- cd ..
|
|
||||||
- pwd
|
|
||||||
- cd FRONT/DEV
|
|
||||||
- pwd
|
|
||||||
- npm install
|
|
||||||
- npm run package
|
|
||||||
- cd dist/gonets-linux-x64/resources/app
|
|
||||||
- pwd
|
|
||||||
- npm run build
|
|
||||||
- sed -i 's#href="/assets/#href="./assets/#g' dist/index.html
|
|
||||||
- sed -i 's#src="/assets/#src="./assets/#g' dist/index.html
|
|
||||||
- cd ../../../../..
|
|
||||||
- pwd
|
|
||||||
- rm -rf BUILD/*
|
|
||||||
- cp -r DEV/dist/gonets-linux-x64/* BUILD/
|
|
||||||
- rm -rf DEV
|
|
||||||
|
|
||||||
# ИНИЦИАЛИЗАЦИЯ DEBIAN КОНФИГУРАЦИЙ ДЛЯ СБОРКИ
|
|
||||||
- cd ..
|
|
||||||
- pwd
|
|
||||||
- cd ..
|
|
||||||
- pwd
|
|
||||||
- mv gonets gonets-0.1
|
|
||||||
- cd gonets-0.1
|
|
||||||
- pwd
|
|
||||||
- ls
|
|
||||||
- DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --single -y --createorig
|
|
||||||
- cd debian/
|
|
||||||
- rm -f *.ex
|
|
||||||
- rm -f README.*
|
|
||||||
|
|
||||||
# КЛОНИРОВАНИЕ НЕОБХОДИМЫХ ШАБЛОНОВ КОНФИГОВ ДЕБИАНА ДЛЯ СБОРКИ
|
|
||||||
- mkdir -p /woodpecker/src/dev.gossys.dev/s.galanskiy/templates
|
|
||||||
- git clone https://s.galanskiy:${GONETS}@dev.gossys.dev/s.galanskiy/gonets-debian-template.git /woodpecker/src/dev.gossys.dev/s.galanskiy/templates
|
|
||||||
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/changelog /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
|
|
||||||
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/control /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
|
|
||||||
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/copyright /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
|
|
||||||
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/install /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
|
|
||||||
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/postinst /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
|
|
||||||
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/postrm /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
|
|
||||||
- mv /woodpecker/src/dev.gossys.dev/s.galanskiy/templates/rules /woodpecker/src/dev.gossys.dev/s.galanskiy/gonets-0.1/debian/
|
|
||||||
|
|
||||||
# СБОРКА ДЕБИАН ПАКЕТА
|
|
||||||
- cd ..
|
|
||||||
- pwd
|
|
||||||
- dpkg-buildpackage -us -uc -b
|
|
||||||
|
|
||||||
# ИЗВЛЕЧЕНИЕ ВЕРСИИ ПАКЕТА ДЛЯ КОММИТА
|
|
||||||
- VERSION=$(dpkg-parsechangelog -l./debian/changelog --show-field Version)
|
|
||||||
- echo "VERSION=$VERSION" > version.env
|
|
||||||
|
|
||||||
# КОММИТ И ТЕГ НА ВЕТКУ DEVELOP
|
|
||||||
- . ./version.env
|
|
||||||
- git config user.name "s.galanskiy"
|
|
||||||
- git config user.email "s.galanskiy@gossys.dev"
|
|
||||||
- git fetch --all --prune
|
|
||||||
- git branch -r
|
|
||||||
- git checkout -b "release/$VERSION"
|
|
||||||
- git commit -am "Релиз $VERSION"
|
|
||||||
- git tag -f "v$VERSION"
|
|
||||||
- git push "https://s.galanskiy:b4785198d18200dfed812dc4299575f736255bd7@dev.gossys.dev/s.galanskiy/gonets.git" "release/$VERSION"
|
|
||||||
- git push -f https://s.galanskiy:b4785198d18200dfed812dc4299575f736255bd7@dev.gossys.dev/s.galanskiy/gonets.git "v$VERSION"
|
|
||||||
|
|
||||||
# СОЗДАНИЕ И ЗАГРУЗКА РЕЛИЗА ЧЕРЕЗ API
|
|
||||||
- VERSION=$(cat version.env | grep VERSION | cut -d'=' -f2)
|
|
||||||
- TAG="v$VERSION"
|
|
||||||
- DEB_PATH="../gonets_${VERSION}_amd64.deb"
|
|
||||||
- |
|
|
||||||
curl -s -X POST "https://dev.gossys.dev/api/v1/repos/s.galanskiy/gonets/releases" \
|
|
||||||
-H "Authorization: token b4785198d18200dfed812dc4299575f736255bd7" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{
|
|
||||||
"tag_name": "'$TAG'",
|
|
||||||
"name": "Релиз '$TAG'",
|
|
||||||
"body": "Сборка .deb пакета для версии '$TAG'",
|
|
||||||
"draft": false,
|
|
||||||
"prerelease": true
|
|
||||||
}' || true
|
|
||||||
- |
|
|
||||||
curl -s -X POST \
|
|
||||||
-H "Authorization: token b4785198d18200dfed812dc4299575f736255bd7" \
|
|
||||||
-F "attachment=@$DEB_PATH" \
|
|
||||||
"https://dev.gossys.dev/api/v1/repos/s.galanskiy/gonets/releases/$TAG/assets"
|
|
||||||
0
file
Normal file
0
file
Normal file
Loading…
Add table
Add a link
Reference in a new issue