|
1 | 1 | on: |
2 | 2 | - workflow_dispatch |
3 | 3 |
|
4 | | -name: Release packages |
| 4 | +name: Release Packages |
5 | 5 |
|
6 | 6 | jobs: |
7 | 7 | build: |
8 | 8 | name: Create the package |
9 | 9 | runs-on: ubuntu-latest |
10 | 10 | environment: github_release |
11 | 11 | steps: |
12 | | - - uses: actions/checkout@v2 |
| 12 | + - uses: actions/checkout@v3 |
13 | 13 |
|
14 | | - - uses: actions/setup-python@v2 |
| 14 | + - uses: actions/setup-python@v4 |
15 | 15 | with: |
16 | | - python-version: 3.9 |
| 16 | + python-version: "3.11" |
17 | 17 |
|
18 | | - - id: sdist |
19 | | - run: python setup.py sdist |
| 18 | + - id: build |
| 19 | + run: pip install hatch==1.6.3 && hatch build |
20 | 20 |
|
21 | 21 | - id: version |
22 | 22 | run: | |
23 | | - printf "::set-output name=version::%s\n" $(python -c "import runpy; print(runpy.run_path('alt_pytest_asyncio/version.py')['VERSION'])") |
24 | | - printf "::set-output name=versiondash::%s\n" $(python -c "import runpy; print(runpy.run_path('alt_pytest_asyncio/version.py')['VERSION'].replace('.', '-'))") |
| 23 | + version=$(python -c "import runpy; print(runpy.run_path('alt_pytest_asyncio/version.py')['VERSION'])") |
| 24 | + versiondash=$(python -c "import runpy; print(runpy.run_path('alt_pytest_asyncio/version.py')['VERSION'].replace('.', '-'))") |
25 | 25 |
|
26 | | - - id: package |
27 | | - run: > |
28 | | - printf "::set-output name=package::alt_pytest_asyncio-${{ steps.version.outputs.version}}.tar.gz" |
29 | | -
|
30 | | - - id: create_release |
31 | | - uses: actions/create-release@v1 |
32 | | - env: |
33 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + echo "version=$version" >> $GITHUB_OUTPUT |
| 27 | + echo "versiondash=$versiondash" >> $GITHUB_OUTPUT |
34 | 28 |
|
| 29 | + - id: create-release |
| 30 | + uses: softprops/action-gh-release@v1 |
35 | 31 | with: |
| 32 | + name: alt_pytest_asyncio ${{ steps.version.outputs.version }} |
| 33 | + body: "https://github.com/delfick/python-alt_pytest_asyncio#release-${{ steps.version.outputs.versiondash }}" |
36 | 34 | tag_name: "release-${{ steps.version.outputs.version }}" |
37 | | - release_name: alt_pytest_asyncio ${{ steps.version.outputs.version }} |
38 | | - body: "https://github.com/delfick/alt-pytest-asyncio#release-${{ steps.version.outputs.versiondash }}" |
| 35 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + fail_on_unmatched_files: true |
39 | 37 | draft: false |
40 | 38 | prerelease: false |
41 | | - |
42 | | - - id: upload-release-asset |
43 | | - uses: actions/upload-release-asset@v1 |
44 | | - env: |
45 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
46 | | - with: |
47 | | - upload_url: ${{ steps.create_release.outputs.upload_url }} |
48 | | - asset_path: "dist/${{ steps.package.outputs.package }}" |
49 | | - asset_name: ${{ steps.package.outputs.package }} |
50 | | - asset_content_type: application/tar+gzip |
| 39 | + files: "dist/*" |
51 | 40 |
|
52 | 41 | |
53 | 42 | with: |
|
0 commit comments