1313 lfs : true
1414
1515 - name : setup CI
16- uses : lava-nc/ci-setup-composite-action@v1.2
16+ uses : lava-nc/ci-setup-composite-action@v1.3
1717 with :
1818 repository : ' Lava'
1919
@@ -44,14 +44,14 @@ jobs:
4444 with :
4545 name : lava
4646
47- - name : Set up Python 3.9
47+ - name : Set up Python 3.10
4848 uses : actions/setup-python@v4
4949 with :
50- python-version : 3.9
50+ python-version : " 3.10 "
5151
5252 - name : Test artifact tar.gz
5353 run : |
54- python3.9 -m venv artifact-test
54+ python3 -m venv artifact-test
5555 source artifact-test/bin/activate
5656 artifact=$(ls | grep lava | grep tar)
5757 pip install --no-input $artifact
6363
6464 - name : Test artifact .whl
6565 run : |
66- python3.9 -m venv artifact-test
66+ python3 -m venv artifact-test
6767 source artifact-test/bin/activate
6868 artifact=$(ls | grep lava | grep whl)
6969 pip install --no-input $artifact
@@ -85,17 +85,17 @@ jobs:
8585 with :
8686 name : lava
8787
88- - name : Set up Python 3.9
88+ - name : Set up Python 3.10
8989 uses : actions/setup-python@v4
9090 with :
91- python-version : 3.9
91+ python-version : " 3.10 "
9292
9393 - name : Test artifact tar.gz
9494 run : |
9595 mkdir tmp
9696 cd tmp
9797 cp ../lava* .
98- python3.9 -m venv artifact-unittest
98+ python3 -m venv artifact-unittest
9999 source artifact-unittest/bin/activate
100100 pip install -U pip
101101 pip install "nbconvert>=7.2.10,<7.3" pytest>=7.2.0 matplotlib>=3.5.1 ipykernel>=6.15.0 nbformat>=5.3.0
@@ -114,7 +114,7 @@ jobs:
114114 mkdir tmp
115115 cd tmp
116116 cp ../lava* .
117- python3.9 -m venv artifact-unittest
117+ python3 -m venv artifact-unittest
118118 source artifact-unittest/bin/activate
119119 pip install -U pip
120120 pip install "nbconvert>=7.2.10,<7.3" pytest>=7.2.0 matplotlib>=3.5.1 ipykernel>=6.15.0 nbformat>=5.3.0
@@ -129,3 +129,64 @@ jobs:
129129 deactivate
130130 cd ../
131131 rm -rf tmp
132+
133+ upload-release-artifact :
134+ name : Upload release artifact
135+ runs-on : ubuntu-latest
136+ if : github.triggering_actor == 'mgkwill' || github.triggering_actor == 'PhilippPlank' || github.triggering_actor == 'tim-shea'
137+ permissions :
138+ contents : write
139+ needs : [build-artifacts, test-artifact-install, test-artifact-use]
140+
141+ steps :
142+ - uses : actions/checkout@v3
143+ with :
144+ lfs : true
145+
146+ - name : setup CI
147+ uses : lava-nc/ci-setup-composite-action@v1.3
148+ with :
149+ repository : ' Lava'
150+
151+ - name : Download lava artifact
152+ uses : actions/download-artifact@v3
153+ with :
154+ name : lava
155+
156+ - name : Check Version
157+ id : check-version
158+ run : |
159+ [[ "$(pipx run poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || echo prerelease=true >> $GITHUB_OUTPUT
160+ echo "release-version=$(pipx run poetry version --short)" >> $GITHUB_OUTPUT
161+ echo "release-commit=$(git log -n 1 --pretty=format:"%H")" >> $GITHUB_OUTPUT
162+
163+ - name : Print Versions
164+ run : |
165+ [[ "$(pipx run poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || echo prerelease=true
166+ echo "release-version=$(pipx run poetry version --short)"
167+ echo "release-commit=$(git log -n 1 --pretty=format:"%H")"
168+
169+ - name : Create Release
170+ uses : ncipollo/release-action@v1
171+ with :
172+ artifacts : " lava*"
173+ token : ${{ secrets.GITHUB_TOKEN }}
174+ draft : true
175+ prerelease : steps.check-version.outputs.prerelease == 'true'
176+ name : " Lava ${{ steps.check-version.outputs.release-version }}"
177+ commit : " ${{ steps.check-version.outputs.release-commit }}"
178+ tag : " v${{ steps.check-version.outputs.release-version }}"
179+ discussionCategory : " Announcements"
180+ artifactErrorsFailBuild : true
181+ generateReleaseNotes : true
182+ makeLatest : true
183+
184+ - name : Publish to PyPI
185+ if : steps.check-version.outputs.prerelease != 'true'
186+ env :
187+ POETRY_PYPI_TOKEN_PYPI : ${{ secrets.PYPI_TOKEN }}
188+ run : |
189+ mkdir dist
190+ cp lava* dist/.
191+ # poetry config repositories.testpypi https://test.pypi.org/legacy/
192+ poetry publish --dry-run
0 commit comments