From d36aa6eaab1abfe40b49e7d21c077ed6cf3549e5 Mon Sep 17 00:00:00 2001 From: Gaurav Mishra Date: Thu, 2 Nov 2023 17:24:27 +0530 Subject: [PATCH] feat(ci): lint and publish Add new GitHub Action workflows to lint the REUSE requirements and publish package on PyPI whenever a release is tagged. Signed-off-by: Gaurav Mishra --- .github/workflows/release-publish.yml | 37 +++++++++++++++++++++++++++ .github/workflows/reuse-lint.yml | 25 ++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/release-publish.yml create mode 100644 .github/workflows/reuse-lint.yml diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml new file mode 100644 index 0000000..570671e --- /dev/null +++ b/.github/workflows/release-publish.yml @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: © 2023 Siemens AG +# SPDX-FileContributor: Gaurav Mishra + +# SPDX-License-Identifier: LGPL-2.1-only + +name: Publish Release Packages + +on: + release: + types: + - published + +jobs: + pypi-publish: + runs-on: ubuntu-latest +# environment: +# name: pypi +# url: https://pypi.org/p/safaa +# permissions: +# id-token: write + steps: + - uses: actions/checkout@v4 + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + architecture: 'x64' + - name: Install wheel + run: python3 -m pip install --upgrade wheel + - name: Build packages + run: python3 setup.py sdist bdist_wheel + working-directory: ./Safaa + - name: Upload Packages to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/reuse-lint.yml b/.github/workflows/reuse-lint.yml new file mode 100644 index 0000000..db0ad2d --- /dev/null +++ b/.github/workflows/reuse-lint.yml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: © 2023 Siemens AG +# SPDX-FileContributor: Gaurav Mishra + +# SPDX-License-Identifier: LGPL-2.1-only + +name: Static lints + +concurrency: + group: static-${{ github.head_ref }} + cancel-in-progress: true + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + REUSE-Compliance-Check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: REUSE Compliance Check + uses: fsfe/reuse-action@v2