|
1 | | -name: Bump, Release, and Publish |
| 1 | +name: Bump, Publish, and Release |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_dispatch: |
|
19 | 19 | default: false |
20 | 20 | type: boolean |
21 | 21 |
|
22 | | -concurrency: |
23 | | - group: tag-and-release |
24 | | - cancel-in-progress: true |
25 | | - |
26 | 22 | jobs: |
27 | | - deploy: |
28 | | - runs-on: ubuntu-latest |
29 | | - steps: |
30 | | - - uses: actions/checkout@v3 |
31 | | - with: |
32 | | - persist-credentials: false |
33 | | - fetch-depth: 0 |
34 | | - submodules: true |
35 | | - - name: Set up Python |
36 | | - uses: actions/setup-python@v4 |
37 | | - - name: Install Poetry |
38 | | - uses: snok/install-poetry@v1 |
39 | | - with: |
40 | | - virtualenvs-create: true |
41 | | - virtualenvs-in-project: true |
42 | | - installer-parallel: true |
43 | | - - name: Bump Version |
44 | | - run: poetry version ${{ github.event.inputs.newversion }} |
45 | | - - name: Get New Version |
46 | | - id: get-new-version |
47 | | - run: | |
48 | | - echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT |
49 | | - - name: Install dependencies |
50 | | - run: poetry install --with dev --no-interaction --no-root |
51 | | - - name: Install project |
52 | | - run: poetry install --with dev --no-interaction |
53 | | - - name: Run tests |
54 | | - run: | |
55 | | - source .venv/bin/activate |
56 | | - pytest tests/ |
57 | | - - name: Poetry Build |
58 | | - run: | |
59 | | - poetry build |
60 | | - - name: Poetry Publish to PyPi Test |
61 | | - if: ${{ 'true' == github.event.inputs.testpublish }} |
62 | | - run: | |
63 | | - poetry config repositories.testpypi https://test.pypi.org/legacy/ |
64 | | - poetry publish --repository testpypi --no-interaction --skip-existing |
65 | | - env: |
66 | | - POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TEST_PYPI_API_TOKEN }} |
67 | | - - name: Poetry Publish to PyPi |
68 | | - run: | |
69 | | - poetry publish --no-interaction |
70 | | - env: |
71 | | - POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} |
72 | | - - name: Commit & Push changes |
73 | | - uses: actions-js/[email protected] |
74 | | - with: |
75 | | - |
76 | | - author_name: ${{ github.actor }} |
77 | | - message: |
78 | | - "[skip ci] bumped to ${{ steps.get-new-version.outputs.version }}" |
79 | | - github_token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }} |
80 | | - - name: Tag version |
81 | | - id: tag-version |
82 | | - uses: mathieudutour/[email protected] |
83 | | - with: |
84 | | - custom_tag: ${{ steps.get-new-version.outputs.version }} |
85 | | - create_annotated_tag: true |
86 | | - github_token: ${{ secrets.VERSION_BUMP_TAG_TOKEN }} |
87 | | - - name: Create a GitHub release |
88 | | - uses: ncipollo/release-action@v1 |
89 | | - with: |
90 | | - tag: ${{ steps.tag-version.outputs.new_tag }} |
91 | | - name: ${{ steps.tag-version.outputs.new_tag }} |
92 | | - body: ${{ steps.tag-version.outputs.changelog }} |
| 23 | + publish: |
| 24 | + uses: prosegrinder/.github/.github/workflows/python-poetry-publish.yaml@main |
| 25 | + with: |
| 26 | + newversion: ${{ github.event.inputs.newversion }} |
| 27 | + testpublish: ${{ 'true' == github.event.inputs.testpublish }} |
| 28 | + secrets: |
| 29 | + TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} |
| 30 | + PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
| 31 | + VERSION_BUMP_TAG_TOKEN: ${{ secrets.VERSION_BUMP_TAG_TOKEN }} |
0 commit comments