Skip to content

fix: added downloading of packages with required and important priority #25

fix: added downloading of packages with required and important priority

fix: added downloading of packages with required and important priority #25

Workflow file for this run

# This workflow will:
# - lint, check formatting and run tests
# - build binaries using pyinstaller for multiple operating systems
# - create a release using conventional commits which includes the build binaries
name: Python application
on:
push:
branches: [ "main" ]
paths:
- 'src/*'
- 'main.py'
- '.github/workflows/*'
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: pip install -r requirements-dev.txt
- name: Lint
run: ruff check .
- name: Check formatting
run: black --check .
- name: Type check
run: mypy --exclude tests --check .
- name: Test
run: pytest
- name: Test git download and install
run: /bin/bash ./tests/acceptance_tests/install_git.sh --no-progress-bar
build_executables:
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
TARGET: windows
OUTPUT_FILE: .\dist\pyapt.exe
UPLOAD_NAME: pyapt.exe
- os: ubuntu-latest
TARGET: ubuntu
OUTPUT_FILE: ./dist/pyapt
UPLOAD_NAME: pyapt-ubuntu
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Build with pyinstaller for ${{ matrix.TARGET }}
run: pyinstaller --onefile --clean --name pyapt main.py
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: builds
path: ${{ matrix.OUTPUT_FILE }}
build_merged_python:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: pip install black isort
- name: Merge source files
run: cat src/progress_bar.py src/sources_list.py src/version.py src/package.py src/index.py src/file_manager.py src/install.py main.py | python .github/clean_imports.py | isort --float-to-top - | black - > pyapt.py
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: builds
path: pyapt.py
create_release:
needs: [build_executables, build_merged_python]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Conventional changelog action
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
fallback-version: 1.0.0
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Download all build artifacts
uses: actions/download-artifact@v3
with:
name: builds
path: builds/
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
files:
builds/*