pomdp-py package pypi deployment #12
Workflow file for this run
This file contains 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: pomdp-py package pypi deployment | |
on: | |
push: | |
tags: | |
- 'v*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
testpypi-publish: | |
name: publish to Test PyPi | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/tags/vdev-latest' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/pomdp-py/ | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
contents: write | |
steps: | |
- name: Set Variables | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: echo "RELEASE_NAME=\"Version ${{ github.ref_name }}\"" >> $GITHUB_ENV | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: 'dev-latest' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Run release script | |
working-directory: . | |
run: | | |
cd scripts | |
./pomdp_py_release.sh ${{ vars.RELEASE_ATTEMPT_COUNT }} | |
- name: Upload to Test PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
# This will upload stuff under dist/ to PyPI | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
- name: Release artifact | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ env.RELEASE_NAME }} | |
files: dist/*.whl | |
pypi-publish: | |
name: publish to PyPi | |
runs-on: ubuntu-latest | |
if: ${{ github.ref != 'refs/tags/vdev-latest' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
environment: | |
name: pypi | |
url: https://pypi.org/p/pomdp-py/ | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
contents: write | |
steps: | |
- name: Set Variables | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
TAG=${{ github.ref_name }} | |
echo "RELEASE_NAME=\"Version $TAG\"" >> $GITHUB_ENV | |
echo "VERSION=${TAG#v}" >> $GITHUB_ENV | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: "main" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Run release script | |
working-directory: . | |
run: | | |
cd scripts | |
./pomdp_py_release.sh ${{ vars.RELEASE_ATTEMPT_COUNT }} | |
- name: Upload to PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
# This will upload stuff under dist/ to PyPI | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
repository_url: https://pypi.org/ | |
skip-existing: true | |
- name: Release artifact | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ env.RELEASE_NAME }} | |
files: dist/*.whl |