|
| 1 | +name: Alpha-Deploy |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [alpha-test] |
| 6 | + |
| 7 | + |
| 8 | +jobs: |
| 9 | + last-minute-test: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + - name: set up python 3.12 |
| 14 | + uses: actions/setup-python@v5 |
| 15 | + with: |
| 16 | + python-version: 3.12 |
| 17 | + - run: pip install . montepy[develop] |
| 18 | + - run: python -m pytest |
| 19 | + |
| 20 | + build-packages: |
| 21 | + name: Build, sign, and release packages on github |
| 22 | + runs-on: ubuntu-latest |
| 23 | + needs: [last-minute-test] |
| 24 | + permissions: |
| 25 | + contents: write # IMPORTANT: mandatory for making GitHub Releases |
| 26 | + id-token: write # IMPORTANT: mandatory for sigstore |
| 27 | + env: |
| 28 | + GH_TOKEN: ${{ github.token }} |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + fetch-tags: true |
| 34 | + - name: set up python 3.12 |
| 35 | + uses: actions/setup-python@v5 |
| 36 | + with: |
| 37 | + python-version: 3.12 |
| 38 | + - run: pip install . montepy[build] |
| 39 | + - name: Get Version |
| 40 | + id: get_version |
| 41 | + run: echo "version=`python -m setuptools_scm`" >> $GITHUB_OUTPUT |
| 42 | + - name: Verify that this is a non-dev alpha release |
| 43 | + run: .github/scripts/check_version.py --alpha |
| 44 | + - run: python -m build . |
| 45 | + - name: Sign the dists with Sigstore |
| 46 | + uses: sigstore/gh-action-sigstore-python@v3.0.0 |
| 47 | + with: |
| 48 | + inputs: >- |
| 49 | + ./dist/*.tar.gz |
| 50 | + ./dist/*.whl |
| 51 | + - name: Create a GitHub release |
| 52 | + uses: ncipollo/release-action@v1 |
| 53 | + with: |
| 54 | + tag: v${{ steps.get_version.outputs.version }} |
| 55 | + name: Release ${{ steps.get_version.outputs.version }} |
| 56 | + draft: true |
| 57 | + - run: >- |
| 58 | + gh release upload |
| 59 | + 'v${{ steps.get_version.outputs.version }}' dist/** |
| 60 | + --repo '${{ github.repository }}' |
| 61 | + - uses: actions/upload-artifact@v4 |
| 62 | + with: |
| 63 | + name: build |
| 64 | + path: | |
| 65 | + dist/*.tar.gz |
| 66 | + dist/*.whl |
| 67 | +
|
| 68 | +
|
| 69 | + deploy-test-pypi: |
| 70 | + environment: |
| 71 | + name: test-pypi |
| 72 | + url: https://test.pypi.org/p/montepy # Replace <package-name> with your PyPI project name |
| 73 | + needs: [build-packages] |
| 74 | + permissions: |
| 75 | + contents: read |
| 76 | + id-token: write |
| 77 | + runs-on: ubuntu-latest |
| 78 | + steps: |
| 79 | + - uses: actions/download-artifact@v4 |
| 80 | + with: |
| 81 | + name: build |
| 82 | + path: dist/ |
| 83 | + - name: Publish distribution 📦 to PyPI |
| 84 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 85 | + with: |
| 86 | + repository-url: https://test.pypi.org/legacy/ |
| 87 | + |
| 88 | + deploy-pypi: |
| 89 | + environment: |
| 90 | + name: pypi |
| 91 | + url: https://pypi.org/p/montepy # Replace <package-name> with your PyPI project name |
| 92 | + needs: [deploy-test-pypi, build-packages] |
| 93 | + permissions: |
| 94 | + contents: read |
| 95 | + id-token: write |
| 96 | + runs-on: ubuntu-latest |
| 97 | + steps: |
| 98 | + - uses: actions/download-artifact@v4 |
| 99 | + with: |
| 100 | + name: build |
| 101 | + path: dist/ |
| 102 | + - name: Publish distribution 📦 to PyPI |
| 103 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
0 commit comments