Skip to content

Commit e085472

Browse files
authored
Fix publish workflow (#6)
* 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
1 parent c008405 commit e085472

File tree

3 files changed

+532
-630
lines changed

3 files changed

+532
-630
lines changed

.github/workflows/publish.yaml

+35-19
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,46 @@
1-
name: Publish ixmp4
1+
# copied from https://github.com/marketplace/actions/install-poetry-action
2+
name: publish
3+
24
on:
35
push:
46
tags: ["v*"]
57
release:
68
types: ["published"]
7-
workflow_dispatch:
9+
810
jobs:
9-
build:
11+
publish:
1012
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
1115
steps:
12-
- uses: actions/checkout@v3
13-
# publish to pypi
14-
- if: github.event_name == 'release'
15-
name: Build and publish to pypi
16-
uses: JRubics/[email protected]
16+
#----------------------------------------------
17+
# check-out repo and set-up python
18+
#----------------------------------------------
19+
- name: Check out repository
20+
uses: actions/checkout@v3
21+
- name: Set up python
22+
id: setup-python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: "3.10"
26+
#----------------------------------------------
27+
# ----- install & configure poetry -----
28+
#----------------------------------------------
29+
- name: Install Poetry
30+
uses: snok/install-poetry@v1
1731
with:
18-
pypi_token: ${{ secrets.PYPI_TOKEN }}
19-
plugins: "poetry-dynamic-versioning[plugin]"
20-
python_version: "3.10"
21-
# publish to testpypi
32+
virtualenvs-create: true
33+
virtualenvs-in-project: true
34+
installer-parallel: true
35+
- name: Install poetry dynamic versioning plugin
36+
run: poetry self add "poetry-dynamic-versioning[plugin]"
37+
- name: Build package
38+
run: poetry build
39+
- if: github.event_name == 'release'
40+
name: Publish distribution to PyPI
41+
uses: pypa/gh-action-pypi-publish@release/v1
2242
- if: github.event_name != 'release'
23-
name: Build and publish to testpypi
24-
uses: JRubics/poetry-publish@v1.16
43+
name: Publish distribution to Test PyPI
44+
uses: pypa/gh-action-pypi-publish@release/v1
2545
with:
26-
python_version: "3.10"
27-
repository_name: "testpypi"
28-
repository_url: "https://test.pypi.org/legacy/"
29-
pypi_token: ${{ secrets.TESTPYPI_TOKEN }}
30-
plugins: "poetry-dynamic-versioning[plugin]"
46+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)