forked from idaholab/MontePy
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (96 loc) · 3.06 KB
/
deploy.yml
File metadata and controls
109 lines (96 loc) · 3.06 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
name: Deploy
on:
push:
branches: [main]
jobs:
last-minute-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: set up python 3.14
uses: actions/setup-python@v6
with:
python-version: 3.14
- run: pip install . montepy[develop]
- run: python -m pytest
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@v6
with:
fetch-depth: 0
fetch-tags: true
- name: set up python 3.14
uses: actions/setup-python@v6
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@cd06a1783504a0c8e550f0d0cd47d3bbae8d71bd
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create a GitHub release
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b
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@v7
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@v8
with:
name: build
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
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@v8
with:
name: build
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e