summaryrefslogtreecommitdiff
path: root/.github/workflows/packaging.yml
blob: 54c9e28d0646f0e9185962b413201e3c8297b399 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Packaging

on:
  push:
  release:
    types: [published]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest]
        python-version: [pypy-3.7, 3.9]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: python -m pip install build
    - name: Create packages
      run: python -m build .
    - uses: actions/upload-artifact@v2
      with:
        name: dist-${{ matrix.os }}-${{ matrix.python-version }}
        path: dist
    - name: Publish package
      if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && matrix.python-version == 'pypy3' && runner.os == 'Linux'
      uses: pypa/gh-action-pypi-publish@master
      with:
        user: __token__
        password: ${{ secrets.pypi_password }}