|
1 | 1 | ---
|
2 | 2 | name: CI
|
3 | 3 |
|
4 |
| -on: [push, pull_request] |
| 4 | +on: [push, pull_request, workflow_dispatch] |
5 | 5 |
|
6 | 6 | permissions:
|
7 |
| - contents: read |
| 7 | + contents: write |
8 | 8 |
|
9 | 9 | jobs:
|
10 |
| - distros: |
11 |
| - name: "Ubuntu with Python ${{ matrix.python-version }}" |
12 |
| - runs-on: "ubuntu-20.04" |
| 10 | + build: |
| 11 | + name: "${{ matrix.os }} with Python ${{ matrix.python-version }}" |
| 12 | + runs-on: ${{ matrix.os }} |
13 | 13 | strategy:
|
14 | 14 | fail-fast: false
|
15 | 15 | matrix:
|
16 |
| - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"] |
| 16 | + python-version: ["3.10", "3.11", "pypy3.10"] |
| 17 | + os: ["ubuntu-latest", "macos-latest"] |
17 | 18 | steps:
|
18 | 19 | - name: Checkout
|
19 |
| - uses: "actions/checkout@v2" |
| 20 | + uses: "actions/checkout@v3" |
20 | 21 | - name: Install apt dependencies
|
21 | 22 | run: |
|
22 | 23 | set -ex
|
23 | 24 | sudo apt update
|
24 | 25 | sudo apt install -y ldap-utils slapd enchant-2 libldap2-dev libsasl2-dev apparmor-utils
|
| 26 | + if: runner.os == 'Linux' |
25 | 27 | - name: Disable AppArmor
|
26 | 28 | run: sudo aa-disable /usr/sbin/slapd
|
| 29 | + if: runner.os == 'Linux' |
27 | 30 | - name: Set up Python ${{ matrix.python-version }}
|
28 |
| - uses: actions/setup-python@v2 |
| 31 | + uses: actions/setup-python@v4 |
29 | 32 | with:
|
30 | 33 | python-version: ${{ matrix.python-version }}
|
31 | 34 | - name: "Install Python dependencies"
|
32 | 35 | run: |
|
33 | 36 | set -xe
|
34 | 37 | python -V
|
35 |
| - python -m pip install --upgrade pip setuptools |
36 |
| - python -m pip install --upgrade tox tox-gh-actions |
37 |
| - - name: "Test tox with Python ${{ matrix.python-version }}" |
38 |
| - run: "python -m tox" |
| 38 | + python -m pip install --upgrade pip setuptools build |
| 39 | + - name: "build python-ldap ${{ matrix.python-version }}" |
| 40 | + run: "python -m build" |
| 41 | + - name: Upload a Build Artifact |
| 42 | + uses: actions/upload-artifact@v3 |
| 43 | + with: |
| 44 | + # A file, directory or wildcard pattern that describes what to upload |
| 45 | + path: dist/*.whl |
| 46 | + release: |
| 47 | + name: "Release" |
| 48 | + needs: build |
| 49 | + runs-on: ubuntu-latest |
| 50 | + steps: |
| 51 | + - name: Download Artifacts |
| 52 | + # will download and upack all files from the default artifact named 'artifact' |
| 53 | + uses: actions/download-artifact@v3 |
| 54 | + - name: GH Release |
| 55 | + uses: softprops/action-gh-release@v0.1.15 |
| 56 | + with: |
| 57 | + tag_name: latest |
| 58 | + files: | |
| 59 | + *.whl |
0 commit comments