-
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.
Merge pull request #112 from AusClimateService/34-package-for-pip
34 package for pip
- Loading branch information
Showing
5 changed files
with
141 additions
and
3 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,123 @@ | ||
name: Build and upload to PyPI | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
|
||
build-artifacts: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install PyPi dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install build twine | ||
- name: Build tarball and wheels | ||
run: | | ||
git clean -xdf | ||
git restore -SW . | ||
python -m build | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: releases | ||
path: dist | ||
|
||
publish_pypi_test: | ||
|
||
needs: build-artifacts | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://test.pypi.org/project/acs-axiom | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: releases | ||
path: dist | ||
|
||
- name: Install PyPi dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install build twine | ||
- name: Check build artifacts | ||
run: | | ||
python -m twine check dist/* | ||
pwd | ||
if [ -f dist/axiom-0.0.0.tar.gz ]; then | ||
echo "INVALID VERSION NUMBER" | ||
exit 1 | ||
fi | ||
- name: Publish package distributions to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
publish_pypi_prod: | ||
|
||
needs: publish_pypi_test | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/project/acs-axiom | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: releases | ||
path: dist | ||
|
||
- name: Install PyPi dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install build twine | ||
- name: Check build artifacts | ||
run: | | ||
python -m twine check dist/* | ||
pwd | ||
if [ -f dist/axiom-0.0.0.tar.gz ]; then | ||
echo "INVALID VERSION NUMBER" | ||
exit 1 | ||
fi | ||
- name: Publish package distributions to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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
File renamed without changes.
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ author = Ben Schreoter | |
author_email = [email protected] | ||
license = MIT | ||
description = A prototype utility for validating/applying metadata templates for scientific data. | ||
long_description = file: README.md | ||
long_description = A prototype utility for validating/applying metadata templates for scientific data. | ||
|
||
url = https://github.com/AusClimateService/axiom | ||
classifiers = | ||
|
@@ -34,6 +34,7 @@ install_requires = | |
distributed >= 2022.8.1 | ||
tqdm >= 4.64.1 | ||
Jinja2 >= 3.1.2 | ||
importlib-metadata >= 6.6.0 | ||
|
||
[aliases] | ||
test = pytest | ||
|