Build and Publish / build (push) Successful in 15s
# Conflicts: # common/pyproject.toml # daq/src/aaredaq/spreadsheetupdater.py # gui/pyproject.toml # pyproject.toml # src/aare/daq/tellupdater.py
43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Build and Publish
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
pull_request_target:
|
|
types: [closed]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set Up Python Environment
|
|
run: |
|
|
python3 -m venv venv # Create a virtual environment
|
|
source venv/bin/activate
|
|
pip install twine build
|
|
mkdir dist/
|
|
|
|
- name: Build the common wheel
|
|
run: |
|
|
source venv/bin/activate
|
|
python -m build
|
|
|
|
- name: Upload Package to Gitea PyPI
|
|
if: github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, 'build and publish')
|
|
env:
|
|
TWINE_USERNAME: "__token__" # Username for Twine when using token-based auth
|
|
TWINE_PASSWORD: ${{ secrets.PIP_REPOSITORY_API_TOKEN }} # Use the secret for authentication
|
|
run: |
|
|
source venv/bin/activate
|
|
twine upload --repository-url https://gitea.psi.ch/api/packages/mx/pypi \
|
|
dist/*
|