-
Notifications
You must be signed in to change notification settings - Fork 20
115 lines (102 loc) · 3.44 KB
/
deploy.yml
File metadata and controls
115 lines (102 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Deploy
on:
push:
branches: [main]
jobs:
last-minute-test:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: set up python 3.14
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: 3.14
- run: pip install . montepy[develop]
- run: python -m pytest
build-packages:
name: Build, sign, and release packages on github
environment:
name: build-pypi
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- name: set up python 3.14
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
with:
python-version: 3.14
- 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.py
- run: python -m build .
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@04cffa1d795717b140764e8b640de88853c92acc
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create a GitHub release
run: |
gh release create "v${{ steps.get_version.outputs.version }}" \
--title="Release ${{ steps.get_version.outputs.version }}" \
--generate-notes -d
- run: >-
gh release upload
'v${{ steps.get_version.outputs.version }}' dist/**
--repo '${{ github.repository }}'
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: build
path: |
dist/*.tar.gz
dist/*.whl
deploy-test-pypi:
environment:
name: test-pypi
url: https://test.pypi.org/p/montepy # Replace <package-name> with your PyPI project name
needs: [build-packages]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: build
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
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-test-pypi, build-packages]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: build
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b