|
1 |
| -name: Python package |
| 1 | +name: Publish Test PyPI on Release |
| 2 | + |
2 | 3 | on:
|
3 | 4 | push:
|
4 | 5 | tags:
|
5 |
| - - "v*.*.*.*" |
| 6 | + - 'v*.*.*.*' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
6 | 11 | jobs:
|
7 |
| - build: |
| 12 | + test-pypi-publish: |
| 13 | + name: Upload release to Test PyPI |
8 | 14 | runs-on: ubuntu-latest
|
| 15 | + environment: |
| 16 | + name: testpypi |
| 17 | + url: https://test.pypi.org/project/jsonschema-fill-default/ |
| 18 | + permissions: |
| 19 | + id-token: write |
9 | 20 | steps:
|
10 |
| - - run: echo "Job automatically triggered by a tagged ${{ github.event_name }} event." |
11 |
| - - uses: actions/checkout@v3 |
12 |
| - - name: Build and publish to pypi |
13 |
| - |
| 21 | + - name: Checkout code |
| 22 | + uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Set up Python 3.9 |
| 25 | + uses: actions/setup-python@v5 |
14 | 26 | with:
|
15 |
| - pypi_token: ${{ secrets.TESTPYPI }} |
16 |
| - repository_name: "jsonschema-fill-default" |
17 |
| - repository_url: "https://test.pypi.org/projects/jsonschema-fill-default" |
18 |
| - |
19 |
| - #steps: |
20 |
| - #- uses: actions/checkout@v3 |
21 |
| - #- name: Build and publish to pypi |
22 |
| - |
23 |
| - # with: |
24 |
| - # pypi_token: ${{ secrets.PYPI_TOKEN }} |
| 27 | + python-version: "3.9" |
| 28 | + |
| 29 | + - name: Install Poetry |
| 30 | + run: | |
| 31 | + curl -sSL https://install.python-poetry.org | python - -y |
| 32 | +
|
| 33 | + - name: Update PATH |
| 34 | + run: echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 35 | + |
| 36 | + - name: Update Poetry configuration |
| 37 | + run: poetry config virtualenvs.create false |
| 38 | + |
| 39 | + - name: Install dependencies |
| 40 | + run: poetry install --sync --no-interaction |
| 41 | + |
| 42 | + - name: Package project |
| 43 | + run: poetry build |
| 44 | + |
| 45 | + - name: Publish package distributions to PyPI |
| 46 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 47 | + with: |
| 48 | + repository-url: https://test.pypi.org/legacy/ |
0 commit comments