Skip to content

feat: added linux builds ( .deb, .rpm) (#10) #60

feat: added linux builds ( .deb, .rpm) (#10)

feat: added linux builds ( .deb, .rpm) (#10) #60

Workflow file for this run

name: PyInstaller Build
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.11]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements.txt
run: pip install -r requirements.txt
- name: Install PyInstaller
run: pip install pyinstaller
- name: Build with PyInstaller
run: pyinstaller --onefile --name phase phase-cli.py
- name: Extract version
run: |
export LC_ALL=C.UTF-8
echo "PHASE_CLI_VERSION=$(grep -oP '(?<=__version__ = ")[^"]*' phase-cli.py)" >> $GITHUB_ENV
shell: bash
- name: Package DEB & RPM linux builds
run: |
if [ "${{ runner.os }}" == "Linux" ]; then
sudo apt-get install -y ruby-dev rubygems build-essential && sudo gem install --no-document fpm
fpm -s dir -t deb -n phase -v $PHASE_CLI_VERSION dist/phase=/usr/bin/
fpm -s dir -t rpm -n phase -v $PHASE_CLI_VERSION dist/phase=/usr/bin/
fi
shell: bash
- name: Upload DEB artifact
uses: actions/upload-artifact@v2
with:
name: phase-deb
path: |
*.deb
- name: Upload RPM artifact
uses: actions/upload-artifact@v2
with:
name: phase-rpm
path: |
*.rpm
- name: Upload dist artifact
uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-binary
path: dist/phase*