Skip to content

test: second bump commit test #62

test: second bump commit test

test: second bump commit test #62

name: publish-to-test-pypi
on:
push:
branches: ["test_pypi"]
jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
python-version: "3.x"
- name: Install uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
- name: Install hatch
run: uv tool install hatch
- name: Build distributions with uv
run: uv build
- name: Add build tag
run: |
FILE=$(ls dist/*.whl)
BASE=$(basename "$FILE")
DIST="python_em511"
VERSION=$(grep '^version' pyproject.toml | head -1 | cut -d '"' -f2)
BUILD="build${{ github.run_number }}.${{ github.run_attempt }}"
SUFFIX=$(echo "$BASE" | cut -d'-' -f3-)
NEW="dist/${DIST}-${VERSION}-${BUILD}-${SUFFIX}"
mv "$FILE" "$NEW"
- name: Upload distributions as artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: python-package-distributions-${{ github.run_id }}
path: dist/
publish-to-test-pypi:
name: Publish Python distribution to TestPyPI
needs: [build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/python-em511
permissions:
id-token: write
steps:
- name: Download all build artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: python-package-distributions-${{ github.run_id }}
path: dist/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true