|
26 | 26 | release: |
27 | 27 | types: [published] |
28 | 28 |
|
29 | | -permissions: |
30 | | - contents: read |
31 | | - |
32 | 29 | jobs: |
33 | | - deploy: |
34 | | - |
| 30 | + build: |
| 31 | + name: Build OpenHTF distribution |
35 | 32 | runs-on: ubuntu-latest |
36 | 33 |
|
37 | 34 | steps: |
38 | 35 | - uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + persist-credentials: false |
39 | 38 | - name: Set up Python |
40 | 39 | uses: actions/setup-python@v5 |
41 | 40 | with: |
42 | | - python-version: '3.7' |
43 | | - - name: Install dependencies |
44 | | - run: | |
45 | | - python -m pip install --upgrade pip |
46 | | - python -m pip install tox tox-gh-actions |
47 | | - pip install coveralls |
48 | | - wget https://github.com/protocolbuffers/protobuf/releases/download/v21.6/protoc-21.6-linux-x86_64.zip |
49 | | - unzip protoc-21.6-linux-x86_64.zip |
50 | | - sudo cp bin/protoc /usr/bin/protoc && sudo chmod 777 /usr/bin/protoc |
51 | | - sudo cp -r include/. /usr/include && sudo chmod -R +r /usr/include/google |
52 | | - protoc --version |
53 | | - sudo apt-get install -y libusb-1.0-0-dev libprotobuf-dev swig |
54 | | - pip install build |
55 | | - - name: Build package |
56 | | - run: python -m build |
57 | | - - name: Publish distribution to Test PyPI |
58 | | - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc |
| 41 | + python-version: '3.13' |
| 42 | + - name: Install pypa/build |
| 43 | + run: >- |
| 44 | + python3 -m |
| 45 | + pip install |
| 46 | + build |
| 47 | + --user |
| 48 | + - name: Build a binary wheel and source tarball |
| 49 | + run: python3 -m build |
| 50 | + - name: Store the distribution packages |
| 51 | + uses: actions/upload-artifact@v4 |
| 52 | + with: |
| 53 | + name: python-package-distributions |
| 54 | + path: dist/ |
| 55 | + |
| 56 | + publish-to-pypi: |
| 57 | + name: Publish OpenHTF distribution to PyPI |
| 58 | + if: startsWith(github.ref, 'refs/tags') |
| 59 | + needs: |
| 60 | + - build |
| 61 | + runs-on: ubuntu-latest |
| 62 | + environment: |
| 63 | + name: pypi |
| 64 | + url: https://pypi.org/p/openhtf |
| 65 | + permissions: |
| 66 | + id-token: write |
| 67 | + steps: |
| 68 | + - name: Download all the dists |
| 69 | + uses: actions/download-artifact@v4 |
| 70 | + with: |
| 71 | + name: python-package-distributions |
| 72 | + path: dist/ |
| 73 | + - name: Publish distribution to PyPI |
| 74 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 75 | + |
| 76 | + publish-to-testpypi: |
| 77 | + name: Publish OpenHTF distribution to TestPyPI |
| 78 | + needs: |
| 79 | + - build |
| 80 | + runs-on: ubuntu-latest |
| 81 | + |
| 82 | + environment: |
| 83 | + name: testpypi |
| 84 | + url: https://test.pypi.org/p/openhtf |
| 85 | + |
| 86 | + permissions: |
| 87 | + id-token: write |
| 88 | + |
| 89 | + steps: |
| 90 | + - name: Download all the dists |
| 91 | + uses: actions/download-artifact@v4 |
59 | 92 | with: |
60 | | - password: ${{ secrets.TESTPYPI_PUBLISH_PASSWORD }} |
61 | | - repository_url: https://test.pypi.org/legacy/ |
62 | | - - name: Publish package to PyPI |
63 | | - if: startsWith(github.ref, 'refs/tags') |
64 | | - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc |
| 93 | + name: python-package-distributions |
| 94 | + path: dist/ |
| 95 | + - name: Publish distribution to TestPyPI |
| 96 | + uses: pypa/gh-action-pypi-publish@release/v1 |
65 | 97 | with: |
66 | | - user: __token__ |
67 | | - password: ${{ secrets.PYPI_PUBLISH_PASSWORD }} |
68 | | - skip_existing: true |
| 98 | + repository-url: https://test.pypi.org/legacy/ |
| 99 | + |
0 commit comments