85 lines
No EOL
2.8 KiB
YAML
85 lines
No EOL
2.8 KiB
YAML
name: Gonets Release Debian Packaging
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-release:
|
|
runs-on: debian-latest
|
|
steps:
|
|
- name: Checkout main
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
ref: main
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y python3 python3-pip python3-poetry nodejs npm debhelper devscripts build-essential fakeroot dh-make dpkg-dev
|
|
|
|
- name: Prepare python dependencies
|
|
run: |
|
|
cd SRV
|
|
rm requirements.txt
|
|
poetry export -f requirements.txt --output requirements.txt --without-hashes
|
|
|
|
- name: Build backend
|
|
run: |
|
|
cd SRV
|
|
poetry install
|
|
|
|
- name: Build frontend
|
|
run: |
|
|
cd FRONT/DEV
|
|
npm install
|
|
npm run package
|
|
cd FRONT/DEV/dist/gonets-linux-x64/resources/app
|
|
npm run build
|
|
sed -i 's/href="\/assets\//href=".\/assets\//g' FRONT/DEV/dist/gonets-linux-x64/resources/app/dist/index.html
|
|
sed -i 's/src="\/assets\//src=".\/assets\//g' FRONT/DEV/dist/gonets-linux-x64/resources/app/dist/index.html
|
|
rm -rf FRONT/BUILD/*
|
|
cp -r FRONT/DEV/dist/gonets-linux-x64/* FRONT/BUILD/
|
|
rm -rf FRONT/DEV
|
|
|
|
- name: Preparing build debian package
|
|
run: |
|
|
DEBEMAIL="devteam@gossys.dev" DEBFULLNAME="GOSSYS LLC" dh_make --createorig
|
|
cd debian/
|
|
rm *.ex
|
|
rm README.*
|
|
|
|
- name: Clone debian configuration
|
|
run: |
|
|
git clone https://s.galanskiy:${{e5eaa40af9805f83a05ef70a0c946c03e1688633.GONETS}}@dev.gossys.dev/s.galanskiy/gonets-debian-template.git
|
|
mv gonets-debian-template/changelog gonets/debian/
|
|
mv gonets-debian-template/control gonets/debian/
|
|
mv gonets-debian-template/copyright gonets/debian/
|
|
mv gonets-debian-template/install gonets/debian/
|
|
mv gonets-debian-template/postinst gonets/debian/
|
|
mv gonets-debian-template/postrm gonets/debian/
|
|
mv gonets-debian-template/rules gonets/debian/
|
|
|
|
- name: Build package
|
|
run: |
|
|
dpkg-buildpackage -us -uc -b
|
|
|
|
- name: Get version from changelog
|
|
run: |
|
|
dpkg-parsechangelog -l./debian/changelog --show-field VERSION
|
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
|
|
|
- name: Commit changes to develop
|
|
run: |
|
|
git config user.name "s.galanskiy"
|
|
git config user.email "s.galanskiy@gossys.dev"
|
|
git checkout develop
|
|
git commit -m "Релиз $VERSION"
|
|
git tag "v$VERSION"
|
|
git push origin develop
|
|
git push origin "v$VERSION"
|
|
env:
|
|
VERSION: ${{ env.VERSION }} |