Skip to content

Merge pull request #76 from id8-engineering/dependabot/github_actions… #97

Merge pull request #76 from id8-engineering/dependabot/github_actions…

Merge pull request #76 from id8-engineering/dependabot/github_actions… #97

name: publish-to-test-pypi
on:
push:
branches: ["main"]
jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: "3.x"
- name: Install uv
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
- name: Install hatch
run: uv tool install hatch
- name: Inject unique build tag into VERSION file
run: |
BASE_VERSION=$(cat VERSION)
BUILD=".dev${{ github.run_id }}${{ github.run_number }}${{ github.run_attempt }}"
echo "${BASE_VERSION}${BUILD}" > VERSION
- name: Build distributions with uv
run: uv build --wheel
- 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@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.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