magictk/.gitea/workflows/build.yaml

45 lines
1.7 KiB
YAML

name: Build and Publish
run-name: Build and Publish Package (${{ gitea.actor }})
on: [push]
jobs:
Run:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>
steps:
- name: Info
run: echo "OS=${{ runner.os }} NAME=${{ gitea.event_name }} REPO=${{ gitea.repository }} BRANCH=${{ gitea.ref }} ST=${{ job.status }}"
- name: Prepare Source
run: |
echo "--- write source ---"
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free">/etc/apt/sources.list
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free">>/etc/apt/sources.list
echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free">>/etc/apt/sources.list
echo "deb https://security.debian.org/debian-security bullseye-security main contrib non-free">>/etc/apt/sources.list
cat /etc/apt/sources.list
echo "--- update source ---"
apt-get update
- name: Prepare Python
run: |
apt-get install python3-pip -y
python3 -m pip install setuptools wheel twine -i https://pypi.tuna.tsinghua.edu.cn/simple
- name: CheckOut
uses: http://hmtsai.cn:3000/actions/checkout@v4
- name: Build
run: python3 setup.py sdist bdist_wheel
- name: Check
run: |
echo "pwd:"
pwd
echo "File list:"
ls
echo "Publish list:"
ls dist
- name: Publish
env:
TWINE_PASSWORD: ${{ secrets.PYPI_KEY }}
run: |
twine upload dist/* --verbose --disable-progress-bar