From bd9bcf32668940f35688b2bed08f793a954a4210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davide=20Col=C3=AC?= Date: Fri, 21 Aug 2026 14:18:54 +0200 Subject: [PATCH] ci: add workflow to publish package to GitLab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a GitHub Actions workflow to automate publishing the Python package to the GitLab PyPI registry. This job triggers automatically on pushes to the master branch. The workflow sets up Python 3.10, builds the package using `build`, and uploads the distribution using `twine`. Authentication and registry routing are handled via GitHub secrets (GITLAB_USERNAME, GITLAB_TOKEN, and GITLAB_REPOSITORY_URL). Signed-off-by: Davide Colì --- .github/workflows/push-to-registry.yaml | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/push-to-registry.yaml diff --git a/.github/workflows/push-to-registry.yaml b/.github/workflows/push-to-registry.yaml new file mode 100644 index 0000000..510357f --- /dev/null +++ b/.github/workflows/push-to-registry.yaml @@ -0,0 +1,34 @@ +name: Publish to GitLab PyPI + +on: + push: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10.12' + + - name: Install Build Dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + + - name: Build the Package + run: python -m build + + - name: Publish to GitLab PyPI + env: + TWINE_USERNAME: ${{ secrets.GITLAB_USERNAME }} + TWINE_PASSWORD: ${{ secrets.GITLAB_TOKEN }} + run: | + python -m twine upload --repository-url ${{ secrets.GITLAB_REPOSITORY_URL }} dist/*