Alpine build #65
Workflow file for this run
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: 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* | |
build_apk: | |
name: Build APK | |
runs-on: ubuntu-latest | |
needs: build | |
container: | |
image: alpine:latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install Alpine SDK | |
run: apk add alpine-sdk | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: Linux-binary | |
path: dist | |
- name: Prepare builder | |
run: | | |
adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D builder | |
mkdir /home/builder/package | |
chown builder /home/builder/package | |
- name: Build APK package | |
run: | | |
pwd | |
ls -l | |
cp ./dist/phase /home/builder/package | |
cp ./APKBUILD /home/builder/package | |
cd /home/builder/package | |
su builder -c 'abuild-keygen -a -i' | |
su builder -c 'abuild checksum' | |
su builder -c 'abuild -r' | |
shell: sh | |
- name: Upload APK artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: phase-apk | |
path: /home/builder/packages/home/x86_64/*.apk |