-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make alternative publish workflow proper
- Loading branch information
1 parent
b48c3cb
commit 97ff84c
Showing
2 changed files
with
33 additions
and
65 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 |
---|---|---|
@@ -1,31 +1,44 @@ | ||
name: Publish ixmp4 | ||
# copied from https://github.com/marketplace/actions/install-poetry-action | ||
name: publish | ||
|
||
on: | ||
push: | ||
tags: ["v*"] | ||
release: | ||
types: ["published"] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: sudo apt-get install python-dev | ||
- uses: actions/checkout@v3 | ||
# publish to pypi | ||
- if: github.event_name == 'release' | ||
name: Build and publish to pypi | ||
uses: JRubics/[email protected] | ||
#---------------------------------------------- | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- name: Set up python | ||
id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
#---------------------------------------------- | ||
# ----- install & configure poetry ----- | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} | ||
plugins: "poetry-dynamic-versioning[plugin]" | ||
python_version: "3.10" | ||
# publish to testpypi | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
- name: Install poetry dynamic versioning plugin | ||
run: poetry self add "poetry-dynamic-versioning[plugin]" | ||
- name: Build package | ||
run: poetry build | ||
- if: github.event_name == 'release' | ||
name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
- if: github.event_name != 'release' | ||
name: Build and publish to testpypi | ||
uses: JRubics/poetry-publish@v1.16 | ||
name: Publish distribution to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
python_version: "3.10" | ||
repository_name: "testpypi" | ||
repository_url: "https://test.pypi.org/legacy/" | ||
pypi_token: ${{ secrets.TESTPYPI_TOKEN }} | ||
plugins: "poetry-dynamic-versioning[plugin]" | ||
repository-url: https://test.pypi.org/legacy/ |
This file was deleted.
Oops, something went wrong.