82 lines
No EOL
2.2 KiB
YAML
82 lines
No EOL
2.2 KiB
YAML
name: Release Deb-Mock
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y sbuild schroot debootstrap python3-venv python3-pip
|
|
|
|
- name: Set up virtual environment
|
|
run: |
|
|
python3 -m venv venv
|
|
source venv/bin/activate
|
|
pip install --upgrade pip setuptools wheel twine
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
source venv/bin/activate
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
|
|
- name: Run tests
|
|
run: |
|
|
source venv/bin/activate
|
|
python -m pytest tests/ -v
|
|
|
|
- name: Build package
|
|
run: |
|
|
source venv/bin/activate
|
|
python setup.py sdist bdist_wheel
|
|
|
|
- name: Check package
|
|
run: |
|
|
source venv/bin/activate
|
|
twine check dist/*
|
|
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Release ${{ github.ref }}
|
|
draft: false
|
|
prerelease: false
|
|
|
|
- name: Upload Release Assets
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./dist/deb_mock-${{ github.ref_name }}.tar.gz
|
|
asset_name: deb-mock-${{ github.ref_name }}.tar.gz
|
|
asset_content_type: application/gzip
|
|
|
|
- name: Upload Wheel
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./dist/deb_mock-${{ github.ref_name }}-py3-none-any.whl
|
|
asset_name: deb-mock-${{ github.ref_name }}-py3-none-any.whl
|
|
asset_content_type: application/zip |