-
-
Notifications
You must be signed in to change notification settings - Fork 23
78 lines (75 loc) · 2.13 KB
/
main.yml
File metadata and controls
78 lines (75 loc) · 2.13 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: CI
on:
push:
branches: [main, beta]
pull_request:
branches: [main, beta]
env:
PACKAGES: |
.
packages/lectern
packages/mecha
packages/bolt
jobs:
main:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
environment:
name: pypi
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
- name: Reset workflow sha
run: git reset --hard ${{ github.sha }}
- name: Set up Python
uses: actions/setup-python@v6
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv sync --all-packages --locked --all-extras --dev
- name: Tests
run: |
status=0
for p in $PACKAGES; do
if ! (uv run --directory "$p" pytest -v); then
status=1
fi
done
exit $status
- name: Pyright
run: uv run basedpyright --level error
- name: Ruff
run: uv run ruff check
- name: Ruff format
run: uv run ruff format --check --diff
- name: Release
if: github.event_name == 'push' && github.repository == 'mcbeet/beet'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for p in $PACKAGES; do
uv run --directory "$p" bash -e <<"EOF"
if semantic-release --strict version --no-commit --no-tag; then
uv lock --upgrade-package $(uv version | cut -d " " -f1)
git add "$GITHUB_WORKSPACE/uv.lock"
grep "{ workspace = true }" pyproject.toml | {
while read dep _; do
uv add "$dep>=$(uv version --package $dep --short)"
done
}
git add pyproject.toml
uv build -o dist
semantic-release --strict version
uv publish dist/*
semantic-release publish
fi
EOF
done