Merge pull request #613 from idaholab/sigstore_fix #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| last-minute-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: set up python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - run: pip install . montepy[develop] | |
| - run: python -m pytest | |
| build-pages: | |
| needs: [last-minute-test, build-packages] | |
| environment: | |
| name: github-pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| ref: main | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - run: pip install --user . montepy[doc] | |
| - run: cd doc && make html | |
| - uses: actions/configure-pages@v4 | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| name: deploy-pages | |
| path: doc/build/html/ | |
| build-packages: | |
| name: Build, sign, and release packages on github | |
| runs-on: ubuntu-latest | |
| needs: [last-minute-test] | |
| permissions: | |
| contents: write # IMPORTANT: mandatory for making GitHub Releases | |
| id-token: write # IMPORTANT: mandatory for sigstore | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: set up python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - run: pip install . montepy[build] | |
| - name: Get Version | |
| id: get_version | |
| run: echo "version=`python -m setuptools_scm`" >> $GITHUB_OUTPUT | |
| - name: Verify that this is a non-dev release | |
| run: .github/scripts/check_version.sh ${{ steps.get_version.outputs.version }} | |
| - run: python -m build . | |
| - name: Sign the dists with Sigstore | |
| uses: sigstore/gh-action-sigstore-python@v3.0 | |
| with: | |
| inputs: >- | |
| ./dist/*.tar.gz | |
| ./dist/*.whl | |
| - name: Create a GitHub release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: v${{ steps.get_version.outputs.version }} | |
| name: Release ${{ steps.get_version.outputs.version }} | |
| draft: true | |
| - run: >- | |
| gh release upload | |
| 'v${{ steps.get_version.outputs.version }}' dist/** | |
| --repo '${{ github.repository }}' | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: build | |
| path: | | |
| dist/*.tar.gz | |
| dist/*.whl | |
| deploy-pages: | |
| permissions: | |
| contents: read | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| needs: [build-pages, last-minute-test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: ls -l | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: deploy-pages | |
| - run: ls -l | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| with: | |
| artifact_name: deploy-pages | |
| deploy-test-pypi: | |
| environment: | |
| name: test-pypi | |
| url: https://test.pypi.org/p/montepy # Replace <package-name> with your PyPI project name | |
| needs: [deploy-pages, build-packages] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: build | |
| path: dist/ | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| deploy-pypi: | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/montepy # Replace <package-name> with your PyPI project name | |
| needs: [deploy-pages, deploy-test-pypi, build-packages] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: build | |
| path: dist/ | |
| - name: Publish distribution 📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |