Skip to content

Commit 5addb7c

Browse files
committed
Migrate to uv, update workflows, update RTD config
1 parent 58e980d commit 5addb7c

File tree

7 files changed

+4046
-3027
lines changed

7 files changed

+4046
-3027
lines changed

.github/workflows/docker.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,26 @@ name: Docker
33
on:
44
push:
55
branches:
6-
- '*'
6+
- main
77
tags:
88
- '*'
99
paths-ignore:
1010
- 'docs/**'
11+
pull_request:
12+
branches: [main]
13+
paths-ignore:
14+
- 'docs/**'
1115

1216
jobs:
1317
docker:
18+
name: Docker
19+
1420
runs-on: ubuntu-latest
21+
1522
env:
1623
USER: sdss
1724
APP: lvmcam
25+
1826
steps:
1927
- name: Set docker tags
2028
id: set-tags
@@ -26,23 +34,34 @@ jobs:
2634
then
2735
BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's/[\/]/_/g')
2836
echo TAGS=$USER/$APP:$BRANCH >> $GITHUB_OUTPUT
37+
elif [[ $GITHUB_REF == refs/pull/* ]]
38+
then
39+
BRANCH=${{ github.head_ref || github.ref_name }}
40+
echo TAGS=$USER/$APP:$BRANCH >> $GITHUB_OUTPUT
2941
else
3042
echo TAGS=$USER/$APP:${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
3143
fi
44+
3245
- name: Show tags
3346
run: echo ${{ steps.set-tags.outputs.TAGS }}
47+
3448
- name: Set up QEMU
3549
uses: docker/setup-qemu-action@v3
50+
3651
- name: Set up Docker Buildx
3752
uses: docker/setup-buildx-action@v3
53+
3854
- name: Log in to registry
3955
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
56+
4057
- name: Build and push
4158
id: docker_build
4259
uses: docker/build-push-action@v6
4360
with:
61+
file: docker/Dockerfile
4462
push: true
63+
provenance: false
4564
tags: ghcr.io/${{ steps.set-tags.outputs.TAGS }}
46-
file: docker/Dockerfile
65+
4766
- name: Image digest
4867
run: echo ${{ steps.docker_build.outputs.digest }}

.github/workflows/lint.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,25 @@ on:
1010

1111
jobs:
1212
lint:
13-
runs-on: ubuntu-latest
13+
name: Lint
14+
15+
runs-on: ubuntu-24.04
1416

1517
steps:
1618
- uses: actions/checkout@v4
1719

20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
22+
with:
23+
enable-cache: true
24+
1825
- name: Set up Python
1926
uses: actions/setup-python@v5
2027
with:
21-
python-version: 3.12
22-
cache: 'pip'
28+
python-version: '3.13'
2329

2430
- name: Lint with ruff
2531
run: |
26-
pip install ruff
32+
uv tool install ruff
2733
ruff check python/ tests/
2834
ruff format --check python/ tests/

.github/workflows/release.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ on:
66
name: Create Release
77

88
jobs:
9-
build:
10-
name: Build wheels
11-
runs-on: ubuntu-latest
9+
release:
10+
name: Build and publish
1211

13-
strategy:
14-
matrix:
15-
python-version: ['3.12']
12+
runs-on: ubuntu-24.04
1613

1714
permissions:
1815
contents: write
@@ -23,27 +20,25 @@ jobs:
2320
uses: actions/checkout@v4
2421

2522
- name: Create release
26-
uses: softprops/action-gh-release@v2
23+
uses: taiki-e/create-gh-release-action@v1
2724
with:
28-
name: lvmcam ${{ github.ref_name }}
25+
title: lvmcam $version
26+
changelog: CHANGELOG.md
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v5
31+
with:
32+
enable-cache: true
2933

3034
- name: Set up Python
3135
uses: actions/setup-python@v5
3236
with:
33-
python-version: ${{ matrix.python-version }}
34-
cache: 'pip'
35-
36-
- name: Install dependencies
37-
run: |
38-
python -m pip install --upgrade pip setuptools wheel build
39-
40-
- name: Build wheels
41-
run: |
42-
pyproject-build -w
37+
python-version: '3.12'
4338

44-
- name: Build source
39+
- name: Build source and dist
4540
run: |
46-
pyproject-build -s
41+
uv build
4742
4843
- name: Publish package distributions to PyPI
4944
uses: pypa/gh-action-pypi-publish@release/v1

.readthedocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
version: 2
22

3+
sphinx:
4+
configuration: docs/sphinx/conf.py
5+
36
build:
47
os: ubuntu-20.04
58
tools:

0 commit comments

Comments
 (0)