|
9 | 9 | - completed |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - tag-release: |
| 12 | + release: |
13 | 13 | if: ${{ github.event.workflow_run.conclusion == 'success' }} |
14 | | - name: tag-release - Python 3.10 (ubuntu-latest) |
15 | 14 | runs-on: ubuntu-latest |
16 | | - outputs: |
17 | | - upload_url: ${{ steps.create-release.outputs.upload_url }} |
18 | | - |
19 | | - steps: |
20 | | - - uses: actions/checkout@v3 |
21 | | - |
22 | | - - name: Set up Python environment |
23 | | - uses: actions/setup-python@v4 |
24 | | - with: |
25 | | - python-version: "3.10" |
26 | | - |
27 | | - - name: Install poetry |
28 | | - run: | |
29 | | - python -m pip install --upgrade pip poetry==1.5.1 |
30 | | -
|
31 | | - - name: Prepare release |
32 | | - id: vars |
33 | | - run: | |
34 | | - echo "tag_name=v$(poetry version -s)" >> $GITHUB_ENV |
35 | | - echo "release_name=$(poetry version)" >> $GITHUB_ENV |
36 | | -
|
37 | | - - name: Create release |
38 | | - id: create-release |
39 | | - uses: actions/create-release@v1 |
40 | | - env: |
41 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
42 | | - TAG_NAME: ${{ steps.vars.outputs.tag_name }} |
43 | | - RELEASE_NAME: ${{ steps.vars.outputs.release_name }} |
44 | | - with: |
45 | | - tag_name: ${{ env.TAG_NAME }} |
46 | | - release_name: ${{ env.RELEASE_NAME }} |
47 | | - draft: false |
48 | | - prerelease: false |
49 | | - |
50 | | - publish-sdist: |
51 | | - needs: [tag-release] |
52 | | - name: publish - Python 3.10 (ubuntu-latest) |
53 | | - runs-on: ubuntu-latest |
54 | | - |
55 | 15 | steps: |
56 | 16 | - uses: actions/checkout@v3 |
57 | | - |
58 | | - - name: Set up Python environment |
59 | | - uses: actions/setup-python@v4 |
| 17 | + - uses: actions/setup-python@v4 |
| 18 | + - uses: snok/install-poetry@v1 |
60 | 19 | with: |
61 | | - python-version: "3.10" |
62 | | - |
63 | | - - name: Install poetry |
64 | | - run: | |
65 | | - python -m pip install --upgrade pip poetry==1.5.1 |
| 20 | + virtualenvs-create: true |
| 21 | + virtualenvs-in-project: true |
| 22 | + installer-parallel: true |
66 | 23 |
|
67 | 24 | - name: Build |
68 | 25 | run: | |
69 | | - poetry build |
70 | | -
|
71 | | - - name: Prepare artifacts |
72 | | - id: vars |
73 | | - run: | |
74 | | - echo "asset_path=$(find ./dist -mindepth 1 -print -quit)" >> $GITHUB_ENV |
75 | | - echo "asset_name=databento-*.tar.gz,databento-*.whl" >> $GITHUB_ENV |
76 | | -
|
77 | | - - name: Upload release asset |
78 | | - id: upload-release-asset |
79 | | - uses: actions/upload-release-asset@v1 |
80 | | - env: |
81 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + poetry build --no-interaction |
| 27 | + echo "RELEASE_NAME=$(poetry version)" >> $GITHUB_ENV |
| 28 | + echo "TAG_NAME=v$(poetry version -s)" >> $GITHUB_ENV |
| 29 | + echo "## Release notes" > NOTES.md |
| 30 | + sed -n '4,/^$/p' CHANGELOG.md >> NOTES.md |
| 31 | +
|
| 32 | + - name: Release |
| 33 | + uses: softprops/action-gh-release@v1 |
82 | 34 | with: |
83 | | - upload_url: ${{ needs.tag-release.outputs.upload_url }} |
84 | | - asset_path: ${{ env.ASSET_PATH }} |
85 | | - asset_name: ${{ env.ASSET_NAME }} |
86 | | - asset_content_type: application/zip |
| 35 | + fail_on_unmatched_files: true |
| 36 | + append_body: true |
| 37 | + name: ${{ env.RELEASE_NAME }} |
| 38 | + tag_name: ${{ env.TAG_NAME }} |
| 39 | + body_path: ./NOTES.md |
| 40 | + files: ./dist/* |
87 | 41 |
|
88 | | - - name: Publish to PyPI |
89 | | - id: publish-to-pypi |
| 42 | + - name: Publish |
90 | 43 | env: |
91 | 44 | POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} |
92 | 45 | run: poetry publish |
0 commit comments