Linux Build #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux Build | |
on: | |
workflow_dispatch: | |
jobs: | |
build-lin: | |
if: github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pyinstaller | |
- name: Build Linux Binary | |
run: | | |
pyinstaller --onefile oai.py --name oai --distpath dist/ | |
cp LICENSE dist/ | |
mkdir out && cd dist && tar -zcvf ../out/oai-linux-binary.tar.gz * | |
- name: Generate change log | |
run: | | |
git clone https://github.com/draupner1/oai | |
cd oai | |
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:' * %s' | sed '/Merge/d' > changelog.txt | |
cp changelog.txt .. | |
cd .. | |
rm -fr oai | |
- name: set package version | |
run: | | |
echo "***************************************" | |
dist/oai --version | |
echo "***************************************" | |
echo "DEBIAN_PACKAGE_VERSION=$(dist/oai --version | awk -F: '{print $2}' | tr -d ' ')+$(date +%Y%m%d%H%M)" >> $GITHUB_ENV | |
- name: Build Debian Package | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y dpkg-dev devscripts | |
mv resources/build/deb debian | |
sudo apt-get build-dep -y --no-install-recommends . | |
dch --newversion $DEBIAN_PACKAGE_VERSION -D unstable -m 'Build Debian package.' | |
debuild -b -us -uc | |
mv ../*.deb out/. | |
- name: Upload Linux Binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Linux Binary | |
path: | | |
out/oai-linux-binary.tar.gz | |
- name: Upload Release Linux .deb | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Linux .deb | |
path: | | |
out/*.deb |