Skip to content

debugging

debugging #18

Workflow file for this run

name: Publish to PyPI
on: #trigger event
push:
branches:
- dev/update_to_1.4.2_automate_publishing
permissions:
contents: write #grant access to write to master branch
jobs:
build:
name: Build distribution
#if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
- name: Get latest tag And version
id: get_tag_and_version
run: |
git fetch -a
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
version=$(echo "$latest_tag" | cut -d'v' -f2)
echo "version=$version" >> $GITHUB_ENV
echo "The version is $version"
- name: Extract version from tag
id: extract_version
run: |
tag=${{ steps.get_tag.outputs.tag }}
echo $tag
version=$(echo $tag | cut -d'v' -f2) # Assuming the tag follows a "vX.X.X" format
echo "::set-output name=version::$version"
- name: Update version in pyproject.toml
run: sed -i "s/version = .*/version = \"${{ steps.extract_version.outputs.VERSION }}\"/" pyproject.toml
- name: Install pypa/build
run: |
pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
publish-to-testpypi:
name: Publish
#if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
#if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/neuromancer-test
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}