-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
191 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/requirements" | ||
schedule: | ||
interval: monthly | ||
time: "04:00" | ||
timezone: Europe/Paris | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,76 @@ | ||
|
||
name: Release | ||
name: Run tests and release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
push: | ||
tags: | ||
- "*" | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
env: | ||
PROJECT_FOLDER: "pirogue" | ||
PYTHON_VERSION_RELEASE: "3.9" | ||
PIROGUE_VERSION: ${{ github.ref_name }} | ||
|
||
jobs: | ||
release: | ||
name: Deploy to PyPi | ||
tests: | ||
name: "Tests" | ||
uses: ./.github/workflows/test.yml | ||
secrets: inherit | ||
|
||
build-python-wheel: | ||
name: "🐍 Python Wheel" | ||
uses: ./.github/workflows/wheel.yml | ||
secrets: inherit | ||
|
||
release-gh: | ||
name: "Release on tag 🚀" | ||
runs-on: ubuntu-latest | ||
needs: [build-python-wheel, tests] | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- name: Retrieve artifact from Python build | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python_wheel | ||
path: dist/ | ||
|
||
- name: Create/update release on GitHub | ||
uses: ncipollo/[email protected] | ||
with: | ||
allowUpdates: true | ||
artifacts: "builds**/*" | ||
generateReleaseNotes: true | ||
omitNameDuringUpdate: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
release-pypi: | ||
name: "🐍 Release on PyPI" | ||
runs-on: ubuntu-latest | ||
needs: [build-python-wheel, tests] | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install requirements | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
pip- | ||
- name: Setup pirogue | ||
run: | | ||
VERSION=${GITHUB_REF:-0.0.0} | ||
VERSION=${VERSION##*/} | ||
sed -i "s/__VERSION__/${VERSION}/g" setup.py | ||
python setup.py install sdist | ||
pirogue -v | ||
- name: Deploy to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
- name: Retrieve artifact from Python build | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python_wheel | ||
path: dist/ | ||
|
||
# -- FROM HERE, A TAG IS REQUIRED --- | ||
- name: Deploy to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
- name: Create/update release on GitHub | ||
uses: ncipollo/[email protected] | ||
with: | ||
allowUpdates: true | ||
artifacts: "dist/*.tar.gz" | ||
generateReleaseNotes: true | ||
omitNameDuringUpdate: true | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "🐍 Python Wheel" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
|
||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
cache: "pip" | ||
cache-dependency-path: "requirements*.txt" | ||
|
||
- name: Install project requirements | ||
run: | | ||
python -m pip install -U pip setuptools wheel | ||
python -m pip install -U -r requirements.txt | ||
python -m pip install -U build | ||
- name: Install project as a package | ||
run: python -m pip install -e . | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m build --sdist --wheel --outdir dist/ . | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: python_wheel | ||
path: dist/* | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.0", "setuptools-scm", "wheel", "setuptools-git-versioning"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
requires-python = ">=3.9" | ||
name = "pirogue" | ||
authors = [ | ||
{name = "Denis Rouzaud", email = "[email protected]"}, | ||
] | ||
description = "pirogue let you dynamically and easily create views in PostgreSQL for inheritance or join scenarios." | ||
keywords = ["postgres"] | ||
classifiers = [ | ||
'Topic :: Database', | ||
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', | ||
'Intended Audience :: System Administrators', | ||
'Intended Audience :: Information Technology', | ||
"Intended Audience :: Developers", | ||
"Programming Language :: Python :: 3", | ||
] | ||
license = { text = "MIT License" } | ||
dynamic = ["version", "readme", "dependencies", "optional-dependencies"] | ||
|
||
[project.urls] | ||
homepage = "https://opengisch.github.io/pirogue/" | ||
repository = "https://github.com/opengisch/pirogue" | ||
tracker = "https://github.com/opengisch/pirogue/issues" | ||
|
||
[tool.setuptools-git-versioning] | ||
enabled = true | ||
|
||
[tool.setuptools.dynamic] | ||
readme = {file = ["README.md"], content-type = "text/markdown"} | ||
dependencies = {file = ["requirements.txt"]} | ||
optional-dependencies.test = {file = ["requirements-test.txt"]} | ||
|
||
[tool.isort] | ||
profile = "black" | ||
|
||
[tool.black] | ||
line-length = 120 |
File renamed without changes.