Skip to content

Commit c4db081

Browse files
committed
Fix CI for publishing
1 parent ad9d582 commit c4db081

File tree

7 files changed

+265
-130
lines changed

7 files changed

+265
-130
lines changed

.github/workflows/build.yaml

+75-29
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ env:
1515
PYTHON_VERSION: 3.11
1616

1717
jobs:
18-
packages-build:
19-
name: Build packages
18+
checks:
19+
name: Check code
2020
runs-on: ubuntu-latest
2121
env:
2222
RUFF_FORMAT: github
@@ -29,30 +29,70 @@ jobs:
2929
with:
3030
python-version: ${{ env.PYTHON_VERSION }}
3131

32-
- name: Prepare virtual environment
33-
run: make create-env
32+
- uses: astral-sh/setup-uv@v4
3433

3534
- name: Check format
3635
run: |
3736
make check-format || true
3837
BOLDRED=$(tput bold && tput setaf 1)
3938
RESET=$(tput sgr0)
40-
echo "${BOLDRED}==> We won't fail on formatting errors for the time being, but we will in the future.${RESET}"
39+
echo "${BOLDRED}==> We won't penalise formatting errors for the time being, but we will in the future.${RESET}"
4140
4241
- name: Check lint
4342
run: |
4443
make check-lint || true
4544
BOLDRED=$(tput bold && tput setaf 1)
4645
RESET=$(tput sgr0)
47-
echo "${BOLDRED}==> We won't fail on lint errors for the time being, but we will in the future.${RESET}"
46+
echo "${BOLDRED}==> We won't enforce linting errors for the time being, but we will in the future.${RESET}"
4847
49-
- name: Build packages
50-
run: make build-dist
48+
sdist-build:
49+
name: Build sdist
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Set up Python
56+
uses: actions/setup-python@v5
57+
with:
58+
python-version: ${{ env.PYTHON_VERSION }}
59+
60+
- uses: astral-sh/setup-uv@v4
61+
62+
- name: Build sdist
63+
run: make build-sdist
5164

5265
- name: Upload packages
5366
uses: actions/upload-artifact@v4
5467
with:
55-
name: python-packages
68+
name: sdist
69+
path: dist
70+
71+
wheels-build:
72+
name: Build wheels
73+
runs-on: ${{ matrix.os }}
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
os: [ubuntu-latest, macos-latest]
78+
79+
steps:
80+
- uses: actions/checkout@v4
81+
82+
- name: Set up Python
83+
uses: actions/setup-python@v5
84+
with:
85+
python-version: ${{ env.PYTHON_VERSION }}
86+
87+
- uses: astral-sh/setup-uv@v4
88+
89+
- name: Build wheels
90+
run: make build-wheels
91+
92+
- name: Upload packages
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: wheels-${{ matrix.os }}
5696
path: dist
5797

5898
docker-build:
@@ -67,19 +107,24 @@ jobs:
67107
with:
68108
python-version: ${{ env.PYTHON_VERSION }}
69109

70-
- name: Prepare virtual environment
71-
run: make create-env
110+
- uses: astral-sh/setup-uv@v4
72111

73112
- name: Check Dockerfile
74113
run: make check-docker
75114

76115
- name: Build Docker image
77-
run: make build-image
116+
run: make save-image
78117

79118
# TODO: Enable this when we figure out how to run it without having to download several Gigabytes of data.
80119
# - name: Test Docker image
81120
# run: make run-example
82121

122+
- name: Upload Docker image
123+
uses: actions/upload-artifact@v4
124+
with:
125+
name: docker-image
126+
path: oncodrivefml.tar
127+
83128
docs-build:
84129
name: Build documentation
85130
runs-on: ubuntu-latest
@@ -92,10 +137,9 @@ jobs:
92137
with:
93138
python-version: ${{ env.PYTHON_VERSION }}
94139

95-
- name: Prepare virtual environment
96-
run: make create-env
140+
- uses: astral-sh/setup-uv@v4
97141

98-
- name: Check version matching the tag
142+
- name: Build the docs
99143
shell: bash
100144
run: make docs
101145

@@ -109,10 +153,6 @@ jobs:
109153
name: Check version
110154
runs-on: ubuntu-latest
111155
if: startsWith(github.ref, 'refs/tags/')
112-
needs:
113-
- packages-build
114-
- docker-build
115-
- docs-build
116156

117157
steps:
118158
- uses: actions/checkout@v4
@@ -122,8 +162,7 @@ jobs:
122162
with:
123163
python-version: ${{ env.PYTHON_VERSION }}
124164

125-
- name: Prepare virtual environment
126-
run: make create-env
165+
- uses: astral-sh/setup-uv@v4
127166

128167
- name: Check version matching the tag
129168
run: make check-version
@@ -134,6 +173,8 @@ jobs:
134173
if: startsWith(github.ref, 'refs/tags/')
135174
needs:
136175
- check-version
176+
- sdist-build
177+
- wheels-build
137178

138179
steps:
139180
- uses: actions/checkout@v4
@@ -143,14 +184,15 @@ jobs:
143184
with:
144185
python-version: ${{ env.PYTHON_VERSION }}
145186

146-
- name: Prepare virtual environment
147-
run: make create-env
187+
- uses: astral-sh/setup-uv@v4
148188

149189
- name: Download packages
150190
uses: actions/download-artifact@v4
151191
with:
152-
name: python-packages
192+
path: dist
153193

194+
- run: find ./dist -iname "oncodrive*"
195+
154196
- name: Publish to PyPI
155197
env:
156198
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
@@ -162,18 +204,22 @@ jobs:
162204
runs-on: ubuntu-latest
163205
needs:
164206
- check-version
207+
- docker-build
165208

166209
steps:
167-
- if: ${{ env.DOCKER_USERNAME != '' }}
168-
uses: actions/checkout@v3
210+
- uses: actions/checkout@v4
169211

170212
- name: Set up Python
171213
uses: actions/setup-python@v5
172214
with:
173215
python-version: ${{ env.PYTHON_VERSION }}
174216

175-
- name: Prepare virtual environment
176-
run: make create-env
217+
- uses: astral-sh/setup-uv@v4
218+
219+
- name: Download Docker image
220+
uses: actions/download-artifact@v4
221+
with:
222+
name: docker-image
177223

178224
- name: Login to DockerHub
179225
env:
@@ -182,4 +228,4 @@ jobs:
182228
run: make docker-login
183229

184230
- name: Push Docker image
185-
run: make push-image
231+
run: make load-image push-image

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ docs/build
3838
# External users tests
3939
external_checks
4040

41+
# VSCode
42+
.vscode/
43+
4144
.ruff_cache/
4245
.venv
4346
data/

CHANGELOG.rst CHANGELOG.md

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11

2-
Changelog
3-
=========
2+
# Changelog
43

5-
2.4.0
6-
-----
4+
## 2.5.0
5+
6+
- Adopted uv as a build tool and added a CI/CD pipeline
7+
8+
## 2.4.0
79

810
- The ``--no-indels`` flags only discards indels, it cannot enable their
911
analysis
@@ -13,19 +15,14 @@ Changelog
1315
- Added seed as option in the configuration file
1416
- Updated dependencies and dropped Python 3.5 support
1517

16-
2.3.0
17-
-----
18+
## 2.3.0
1819

1920
- Added option to set the size limit for the indels
2021

21-
2.2.0
22-
-----
22+
## 2.2.0
2323

2424
- Simplified signature computation using bgsignature.
2525
Complex options should be computed externally.
26-
2726
- Adapted to bgparsers 0.9 that require a regions file with header.
28-
2927
- Simplified indels computation as assuming everything in the positive strand.
30-
31-
- Set by default the indels computation as substitutions.
28+
- Set by default the indels computation as substitutions.

0 commit comments

Comments
 (0)