Files
amq-adapter-python/.forgejo/workflows/publish-python.yaml
T
hurui200320 8224e4020f
Unit test coverage / pytest (pull_request) Successful in 2m3s
Unit test coverage / pytest (push) Successful in 1m51s
CI for pypl publish / publish-lib (push) Successful in 1m53s
ci: move back to forgejo
ISSUES CLOSED: clevermicro/amq-adapter-python#8
2025-05-22 04:42:03 +00:00

51 lines
1.5 KiB
YAML

name: "CI for pypl publish"
on:
push:
branches:
- master # publish release on master
- develop # publish snapshot on develop
workflow_dispatch:
# allow manual trigger
env:
DEBIAN_FRONTEND: noninteractive
TZ: UTC
jobs:
publish-lib:
runs-on: general
container:
image: ubuntu:24.04
steps:
# need to setup node and git
- run: |
apt-get update
apt-get install -y nodejs git libsqlite3-0
# check out code
- uses: actions/checkout@v4
- uses: https://github.com/actions/setup-python@v5
with:
python-version: '3.11'
# install dependencies
- run: pip install -e .[dev]
# run pytest
- run: pytest
# replace timestamp building dev version
- name: Add timestamp to version
if: github.head_ref != 'master'
run: |
sed -i -E "s/(version = \"[^\"]+)(-dev)\"/\1\2$(date -u +'%Y%m%d%H%M%S')\"/" pyproject.toml
cat pyproject.toml
- name: Build wheel
run: |
python -m build
# publish
- name: publish to pulp pypi
run: |
twine upload --repository-url https://git.cleverthis.com/api/packages/clevermicro/pypi \
--username ${CI_REGISTRY_USER} \
--password ${CI_REGISTRY_PASSWORD} \
--verbose \
dist/*
env:
CI_REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
CI_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}