|
1 | | -# This workflow will install Python dependencies, run tests and lint with a single version of Python |
2 | | -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
3 | | - |
4 | 1 | name: VoiceAuth application |
5 | 2 |
|
6 | 3 | on: |
|
10 | 7 | branches: [ "master" ] |
11 | 8 |
|
12 | 9 | permissions: |
13 | | - id-token: write # This is required for requesting the JWT |
14 | | - contents: read # This is required for actions/checkout |
| 10 | + id-token: write # Required for requesting the JWT |
| 11 | + contents: write # Required for actions/checkout |
15 | 12 |
|
16 | 13 | jobs: |
17 | 14 | build: |
18 | 15 | name: Build distribution 📦 |
19 | 16 | runs-on: ubuntu-latest |
20 | 17 |
|
21 | 18 | steps: |
22 | | - - uses: actions/checkout@v4 |
| 19 | + - name: Checkout repository |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
23 | 22 | - name: Set up Python |
24 | 23 | uses: actions/setup-python@v5 |
25 | 24 | with: |
26 | | - python-version: "3.10.X" |
27 | | - - name: Install pypa/build |
| 25 | + python-version: "3.10" |
| 26 | + |
| 27 | + - name: Install dependencies |
28 | 28 | run: | |
29 | | - python -m pip install --upgrade -r requirements.txt |
30 | | - pip install build |
31 | | - - name: Build a binary wheel and a source tarball |
| 29 | + python -m pip install --upgrade pip wheel cx_Freeze build twine |
| 30 | + pip install -r requirements.txt build |
| 31 | +
|
| 32 | + - name: Build distribution packages |
32 | 33 | run: | |
33 | | - python -m pip install --upgrade -r requirements.txt |
34 | | - python -m build --no-isolation |
| 34 | + pip install -r requirements.txt build |
| 35 | + python -m setup.py build --no-isolation |
| 36 | +
|
35 | 37 | - name: Store the distribution packages |
36 | 38 | uses: actions/upload-artifact@v4 |
37 | 39 | with: |
38 | 40 | name: python-package-distributions |
39 | 41 | path: dist/ |
40 | | - publish-to-pypi: |
41 | | - name: >- |
42 | | - Publish Python 🐍 distribution 📦 to PyPI |
43 | | - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes |
44 | | - needs: |
45 | | - - build |
46 | | - runs-on: ubuntu-latest |
47 | | - environment: |
48 | | - name: pypi |
49 | | - url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name |
50 | | - steps: |
51 | | - - name: Download all the dists |
52 | | - uses: actions/download-artifact@v4 |
53 | | - with: |
54 | | - name: python-package-distributions |
55 | | - path: dist/ |
56 | | - - name: Publish distribution 📦 to PyPI |
57 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
58 | | - github-release: |
59 | | - name: >- |
60 | | - Sign the Python 🐍 distribution 📦 with Sigstore |
61 | | - and upload them to GitHub Release |
62 | | - needs: |
63 | | - - publish-to-pypi |
64 | | - runs-on: ubuntu-latest |
65 | | - |
66 | | - permissions: |
67 | | - contents: write # IMPORTANT: mandatory for making GitHub Releases |
68 | | - id-token: write # IMPORTANT: mandatory for sigstore |
69 | | - |
70 | | - steps: |
71 | | - - name: Download all the dists |
72 | | - uses: actions/download-artifact@v4 |
73 | | - with: |
74 | | - name: python-package-distributions |
75 | | - path: dist/ |
76 | | - - name: Sign the dists with Sigstore |
77 | | - |
78 | | - with: |
79 | | - inputs: >- |
80 | | - ./dist/*.tar.gz |
81 | | - ./dist/*.whl |
82 | | - - name: Create GitHub Release |
83 | | - env: |
84 | | - GITHUB_TOKEN: ${{ github.token }} |
85 | | - run: >- |
86 | | - gh release create |
87 | | - '${{ github.ref_name }}' |
88 | | - --repo '${{ github.repository }}' |
89 | | - --notes "" |
90 | | - - name: Upload artifact signatures to GitHub Release |
91 | | - env: |
92 | | - GITHUB_TOKEN: ${{ github.token }} |
93 | | - # Upload to GitHub Release using the `gh` CLI. |
94 | | - # `dist/` contains the built packages, and the |
95 | | - # sigstore-produced signatures and certificates. |
96 | | - run: >- |
97 | | - gh release upload |
98 | | - '${{ github.ref_name }}' dist/** |
99 | | - --repo '${{ github.repository }}' |
0 commit comments