-
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.
* Try enabling postgres * Explicitly install libpq-dev * Remove libpq-dev since it's already installed * Switch psycopg2 to psycopg2-binary * Revert poetry.lock * Try installing python-dev * Fix apt-get install command * Add alternative publish workflow * Add dynamic versioning * Set up alternative publishing workflow for repositories * Fix faulty publish workflow * Enable using trusted publisher * Make alternative publish workflow proper * Add missing permission setting
- Loading branch information
1 parent
7470dce
commit 4543b8e
Showing
3 changed files
with
532 additions
and
630 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,30 +1,46 @@ | ||
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 | ||
permissions: | ||
id-token: write | ||
steps: | ||
- 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/ |
Oops, something went wrong.