name: build-pypi

on:
  push:
    branches:
      - stable
      - develop
      - 'release/**'

  pull_request:
    branches:
      - stable
      - 'release/**'

jobs:

  build:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        python-version: ["3.8"]
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install build

    - name: Build PyPi packages
      run: |
        python -m build

    - name: Archive dist
      uses: actions/upload-artifact@v4
      with:
        name: volatility3-pypi
        path: |
          dist/
