1212env :
1313 PIP_DISABLE_PIP_VERSION_CHECK : " 1"
1414 PIP_NO_PYTHON_VERSION_WARNING : " 1"
15- PYTHON_LATEST : " 3.11"
1615
1716jobs :
1817 pre-commit :
2120 - uses : actions/checkout@v3
2221 - uses : actions/setup-python@v4
2322 with :
24- python-version : ${{ env.PYTHON_LATEST }}
23+ python-version : " 3.x "
2524 -
uses :
pre-commit/[email protected] 2625
2726 list :
@@ -56,14 +55,14 @@ jobs:
5655 run : >
5756 sudo apt-get update &&
5857 sudo apt-get install -y libenchant-2-dev
59- if : runner.os == 'Linux'
58+ if : runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs')
6059 - name : Install dependencies
6160 run : brew install enchant
62- if : runner.os == 'macOS'
61+ if : runner.os == 'macOS' && startsWith(matrix.noxenv, 'docs')
6362 - name : Set up Python
6463 uses : actions/setup-python@v4
6564 with :
66- python-version : ${{ env.PYTHON_LATEST }}
65+ python-version : " 3.x "
6766 - name : Set up nox
68676968 - name : Run nox
@@ -72,34 +71,30 @@ jobs:
7271 packaging :
7372 needs : ci
7473 runs-on : ubuntu-latest
74+ environment :
75+ name : PyPI
76+ url : https://pypi.org/p/jsonschema-specifications
77+ permissions :
78+ contents : write
79+ id-token : write
7580
7681 steps :
7782 - uses : actions/checkout@v3
7883 - name : Set up Python
7984 uses : actions/setup-python@v4
8085 with :
81- python-version : ${{ env.PYTHON_LATEST }}
86+ python-version : " 3.x "
8287 - name : Install dependencies
8388 run : python -m pip install build
8489 - name : Create packages
8590 run : python -m build .
86- - uses : actions/upload-artifact@v3
87- with :
88- name : dist
89- path : dist
90- - name : Publish the package
91+ - name : Publish to PyPI
9192 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
9293 uses : pypa/gh-action-pypi-publish@release/v1
93- with :
94- password : ${{ secrets.pypi_password }}
9594 - name : Create a Release
9695 if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
97- uses : actions/github-script@v6
96+ uses : softprops/action-gh-release@v1
9897 with :
99- github-token : ${{ secrets.GITHUB_TOKEN }}
100-
101- script : |
102- await github.request(`POST /repos/${{ github.repository }}/releases`, {
103- tag_name: "${{ github.ref }}",
104- generate_release_notes: true
105- });
98+ files : |
99+ dist/*
100+ generate_release_notes : true
0 commit comments