Skip to content

Commit 3c1adaa

Browse files
committed
ci: add release workflow
1 parent f74ecfb commit 3c1adaa

6 files changed

Lines changed: 499 additions & 43 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ updates:
1515
update-types:
1616
- "minor"
1717
- "patch"
18+
19+
- package-ecosystem: uv
20+
cooldown:
21+
default-days: 7
22+
directory: "/"
23+
schedule:
24+
interval: weekly
25+
groups:
26+
all:
27+
patterns:
28+
- "*"

.github/workflows/ci.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -62,44 +62,6 @@ jobs:
6262
fail_ci_if_error: false
6363
token: ${{ secrets.CODECOV_TOKEN }}
6464

65-
publish:
66-
needs: [tests]
67-
runs-on: ubuntu-latest
68-
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
69-
steps:
70-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
71-
- name: Install uv
72-
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
73-
with:
74-
version: "0.9.*"
75-
enable-cache: true
76-
python-version: ${{ env.LATEST_PY_VERSION }}
77-
78-
- name: Install dependencies
79-
run: |
80-
uv sync
81-
82-
- name: Set tag version
83-
id: tag
84-
run: |
85-
echo "version=${GITHUB_REF#refs/*/}"
86-
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
87-
88-
- name: Set module version
89-
id: module
90-
run: |
91-
echo version=$(python -c'import titiler.stacapi; print(titiler.stacapi.__version__)') >> $GITHUB_OUTPUT
92-
93-
- name: Build and publish
94-
if: ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}}
95-
env:
96-
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }}
97-
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
98-
run: |
99-
rm -rf dist
100-
uv build
101-
uv publish dist/*
102-
10365
publish-docker:
10466
needs: [tests]
10567
# runs on push to main, on tag creation, and on release

.github/workflows/release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
env:
8+
LATEST_PY_VERSION: '3.14'
9+
10+
jobs:
11+
build:
12+
name: Build dist
13+
runs-on: ubuntu-latest
14+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
15+
steps:
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
20+
with:
21+
version: "0.9.*"
22+
enable-cache: true
23+
python-version: ${{ env.LATEST_PY_VERSION }}
24+
25+
- name: Install dependencies
26+
run: |
27+
uv sync --group deploy
28+
29+
- name: Set tag version
30+
id: tag
31+
run: |
32+
echo "version=${GITHUB_REF#refs/*/}"
33+
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
34+
35+
- name: Set module version
36+
id: module
37+
run: |
38+
echo "version=$(uv run hatch --quiet version)" >> $GITHUB_OUTPUT
39+
40+
- name: Check version match
41+
run: |
42+
if [ "${{ steps.tag.outputs.version }}" != "${{ steps.module.outputs.version }}" ]; then
43+
echo "Tag version (${{ steps.tag.outputs.version }}) does not match module version (${{ steps.module.outputs.version }})"
44+
exit 1
45+
fi
46+
47+
- name: Build
48+
run: |
49+
uv run hatch build
50+
51+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
52+
with:
53+
path: ./dist/
54+
55+
upload_pypi:
56+
name: Upload release to PyPI
57+
needs: [build]
58+
runs-on: ubuntu-latest
59+
environment:
60+
# Note: this environment must be configured in the repo settings
61+
name: pypi-release
62+
url: https://pypi.org/p/titiler-stacapi
63+
permissions:
64+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
65+
steps:
66+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
67+
with:
68+
name: artifact
69+
path: dist
70+
merge-multiple: true
71+
72+
- name: Publish package distributions to PyPI
73+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888

8989
* initial release
9090

91-
[Unreleased]: <https://github.com/developmentseed/titiler-stacapi/compare/2.0.0..main>
91+
[Unreleased]: <https://github.com/developmentseed/titiler-stacapi/compare/2.0.1..main>
92+
[2.0.1]: <https://github.com/developmentseed/titiler-stacapi/compare/2.0.0..2.0.1>
9293
[2.0.0]: <https://github.com/developmentseed/titiler-stacapi/compare/1.1.3..2.0.0>
9394
[1.1.3]: <https://github.com/developmentseed/titiler-stacapi/compare/1.1.2..1.1.3>
9495
[1.1.2]: <https://github.com/developmentseed/titiler-stacapi/compare/1.1.1..1.1.2>

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ docs = [
5353
"griffe-inherited-docstrings>=1.0.0",
5454
"mkdocstrings[python]>=0.25.1",
5555
]
56+
deploy = [
57+
"hatch",
58+
]
5659

5760
[project.urls]
5861
Homepage = 'https://developmentseed.org/titiler-stacapi/'

0 commit comments

Comments
 (0)