|
1 |
| -name: Publish ixmp4 |
| 1 | +# copied from https://github.com/marketplace/actions/install-poetry-action |
| 2 | +name: publish |
| 3 | + |
2 | 4 | on:
|
3 | 5 | push:
|
4 | 6 | tags: ["v*"]
|
5 | 7 | release:
|
6 | 8 | types: ["published"]
|
7 |
| - workflow_dispatch: |
| 9 | + |
8 | 10 | jobs:
|
9 |
| - build: |
| 11 | + publish: |
10 | 12 | runs-on: ubuntu-latest
|
| 13 | + permissions: |
| 14 | + id-token: write |
11 | 15 | steps:
|
12 |
| - - uses: actions/checkout@v3 |
13 |
| - # publish to pypi |
14 |
| - - if: github.event_name == 'release' |
15 |
| - name: Build and publish to pypi |
16 |
| - |
| 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 |
17 | 31 | 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 |
22 | 42 | - 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 |
25 | 45 | 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