-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.32 KB
/
ci.yaml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Test, build and create releases.
on:
push:
branches:
- 'main'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- 'main'
workflow_dispatch:
jobs:
test:
name: Test project
strategy:
matrix:
os:
- "windows-latest"
- "ubuntu-latest"
- "macos-latest"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pdm
uses: pdm-project/setup-pdm@v4
- name: Install dependencies
run: pdm install --dev ${{ matrix.os != 'windows-latest' && '--group=uvloop' || '' }}
- name: Test project
run: pdm run pytest
build-and-release:
name: Build project and release if needed
runs-on: "ubuntu-latest"
needs: "test"
permissions:
contents: "write"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pdm
uses: pdm-project/setup-pdm@v4
- name: Install dependencies
run: pdm install --dev --group=uvloop
- name: Build project
run: pdm build
- name: Release
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2
with:
files: "dist/*"
generate_release_notes: true
fail_on_unmatched_files: true