Skip to content

Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml #34

Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml

Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml #34

---
# This workflow will install Python dependencies, run tests
name: Publish on TestPyPI
on: push
jobs:
build-n-publish:
# needs: test
name: Build and upload release to TestPyPI
runs-on: ${{ matrix.os }}
strategy:
fail-fast: True
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
environment:
name: testpypi
url: https://test.pypi.org/p/OTAnalytics-EXAMPLE-TEST-DISTRIBUTION
permissions:
actions: read
contents: read
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Check-out platomo-build repository
uses: actions/checkout@v4
with:
repository: platomo/platomo-build
token: ${{ secrets.PLATOMO_BUILDER_ACCESS }}
path: platomo-build
- name: Install builder dependencies
run: |
cd platomo-build
python -m pip install --upgrade pip
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
if [ -f "requirements-dev.txt" ]; then
pip install -r requirements-dev.txt
fi
- name: Build release assets
run: python ./platomo-build/build.py --package_version 0.0.0.0.12.a1
- name: Display dist content
run: ls -ahl dist/
- name: Display version info
run: cat OTAnalytics/version.py
- name: Patch version
run: echo __version__ = \"0.0.0.0.12.a1\" > OTAnalytics/version.py
- name: Remove File
uses: JesseTG/rm@v1.0.3
with:
path: dist/
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Show dist content
run: ls -ahl dist/
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true