gonets/.forgejo/workflows/release.yml

58 lines
1.8 KiB
YAML
Raw Normal View History

2025-06-26 17:49:21 +05:00
name: Gonets Release Debian Packaging
on:
workflow_dispatch:
jobs:
build-and-release:
runs-on: debian
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Установка всех необходимых зависимостей для сборки
run: |
sudo apt update
sudo apt install -y python3 python3-pip python3-poetry nodejs npm debhelper devscripts build-essential fakeroot dh-make
- name: Сборка backend
run: |
cd SRV
poetry install
- name: Сборка frontend
run: |
cd FRONT/BUILD/resources/app
npm install
npm run build
- name: Build deb package
run: |
dpkg-buildpackage -us -uc -b
- name: Get version from changelog
id: get_version
run: |
VERSION=$(dpkg-parsechangelog | awk '/^Version:/ {print $2}')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create git tag
env:
GIT_PUSH_TOKEN: ${{ secrets.GIT_PUSH_TOKEN }}
run: |
git config --global user.email "ci-bot@example.com"
git config --global user.name "CI Bot"
git tag gonets-${{ steps.get_version.outputs.version }}
git push https://ci-bot:${GIT_PUSH_TOKEN}@${GITEA_SERVER}/${GITEA_REPO}.git gonets-${{ steps.get_version.outputs.version }}
- name: Create release and upload deb
uses: softprops/action-gh-release@v2
with:
tag_name: gonets-${{ steps.get_version.outputs.version }}
name: "Gonets ${{ steps.get_version.outputs.version }}"
files: ../*.deb
env:
GITHUB_TOKEN: ${{ secrets.GIT_PUSH_TOKEN }}