Skip to content

Commit a2a8c4e

Browse files
committed
upload publish.yml
1 parent bbbba05 commit a2a8c4e

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/publish.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*" # Triggers when a tag like 'v3.2.0' is pushed
7+
8+
jobs:
9+
build-and-publish:
10+
name: Build and Publish Packages
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python 3.10
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.10"
20+
21+
- name: Install build dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
26+
- name: Build and publish stac-fastapi-core
27+
working-directory: stac_fastapi/core
28+
env:
29+
TWINE_USERNAME: "__token__" # Hardcoded username for API token authentication
30+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} # Your PyPI API token from GitHub Secrets
31+
run: |
32+
# Build package
33+
python setup.py sdist bdist_wheel
34+
35+
# Publish to PyPI
36+
twine upload dist/*
37+
38+
- name: Build and publish stac-fastapi-elasticsearch
39+
working-directory: stac_fastapi/elasticsearch
40+
env:
41+
TWINE_USERNAME: "__token__"
42+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
43+
run: |
44+
# Build package
45+
python setup.py sdist bdist_wheel
46+
47+
# Publish to PyPI
48+
twine upload dist/*
49+
50+
- name: Build and publish stac-fastapi-opensearch
51+
working-directory: stac_fastapi/opensearch
52+
env:
53+
TWINE_USERNAME: "__token__"
54+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
55+
run: |
56+
# Build package
57+
python setup.py sdist bdist_wheel
58+
59+
# Publish to PyPI
60+
twine upload dist/*

0 commit comments

Comments
 (0)