-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add publish GitHub Action workflow (#87)
* Add publish GitHub Action workflow Signed-off-by: Fabrice Normandin <[email protected]> * Don't install dev dependencies when publishing Signed-off-by: Fabrice Normandin <[email protected]> * Add auto-versioning with a poetry plugin Signed-off-by: Fabrice Normandin <[email protected]> * Remove poetry version from matrix Signed-off-by: Fabrice Normandin <[email protected]> * Modify workflow so it uses PyPI token Signed-off-by: Fabrice Normandin <[email protected]> * Rename env variable based on poetry docs Signed-off-by: Fabrice Normandin <[email protected]> --------- Signed-off-by: Fabrice Normandin <[email protected]>
- Loading branch information
Showing
2 changed files
with
46 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,39 @@ | ||
# This workflow will upload a Python Package using Poetry when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
environment: release | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install poetry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: poetry | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Publish package | ||
env: | ||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | ||
run: poetry publish --build |
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,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "milatools" | ||
version = "0.0.18" | ||
version = "0.0.0" | ||
description = "Tools to work with the Mila cluster" | ||
authors = ["Olivier Breuleux <[email protected]>"] | ||
readme = "README.md" | ||
|
@@ -48,6 +48,10 @@ combine_as_imports = true | |
addopts = "--doctest-modules" | ||
markers = "--enable-internet: Allow some tests to run using real connections to the cluster." | ||
|
||
|
||
[tool.poetry-dynamic-versioning] | ||
enable = true | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] | ||
build-backend = "poetry_dynamic_versioning.backend" |